Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create cubemap from file #93

Merged
merged 56 commits into from
May 18, 2021
Merged

Create cubemap from file #93

merged 56 commits into from
May 18, 2021

Conversation

stf976
Copy link
Collaborator

@stf976 stf976 commented Feb 27, 2021

pull request for implementation of #62 for review;
API documentation not yet included

… to right-handed world space

and vice versa using modelView matrices instead of in shader code;
add comments explaining coordinate system transformations
implement image_resource_t classes for GLI and stb_image loaders;
add factory method create_image_resource_from_file();
implement composite_cubemap_image_resource_t class for creating cubemap from individual files;
update texture_cubemap example
… to right-handed world space

and vice versa using modelView matrices instead of in shader code;
add comments explaining coordinate system transformations
implement image_resource_t classes for GLI and stb_image loaders;
add factory method create_image_resource_from_file();
implement composite_cubemap_image_resource_t class for creating cubemap from individual files;
update texture_cubemap example
simplify image_resource interfaces
fix screen resizing in texture_cubemap example after update
add caching to texture_cubemap example
add loading of dds texture to texture_cubemap example
Copy link
Member

@johannesugb johannesugb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if some of the comments might appear a bit nit-picky, but the framework shall serve users well and features shall be implemented in similar ways, so that users get the chance to "feel at home" with the framework. That means that new features must follow established principles and patterns.

I know that this can be a bit cumbersome from time to time and refactoring will take some time, but it is for a good purpose. It is more important to implement new features in a well and consistent way so that the frameowork feels like as if made from one piece than to implement a lot of new features and each of them requires different usage patterns.

If you have further questions, please do not hesitate to discuss directly at the issues or in Slack!

examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
framework/include/image_resource.hpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
examples/texture_cubemap/source/texture_cubemap.cpp Outdated Show resolved Hide resolved
stf976 and others added 13 commits March 20, 2021 17:59
Co-authored-by: Johannes Unterguggenberger <[email protected]>
make conversion constructors of image_resource_base_t explicit
make variables and parameters const and auto if possible
prevent variable use after std::move
make conversion constructors explicit for image_resource_t classes
Co-authored-by: Johannes Unterguggenberger <[email protected]>
follow naming conventions
use gvk::owned instead of std::move

Co-authored-by: Johannes Unterguggenberger <[email protected]>
…::unique_ptr, adapt code accordingly

add create_image_resource() helper functions
fix compilation errors in texture_cubemap example
…nique_ptr, adapt code accordingly

add create_image_resource() helper functions
fix compilation errors in texture_cubemap example
framework/include/math_utils.hpp Outdated Show resolved Hide resolved
framework/include/math_utils.hpp Outdated Show resolved Hide resolved
framework/src/math_utils.cpp Outdated Show resolved Hide resolved
framework/src/math_utils.cpp Outdated Show resolved Hide resolved
stf976 and others added 8 commits May 10, 2021 20:48
follow naming guidelines for parameters
…uct options`. This should improve readability.

- Removed useless `updater` calls and restructured the remaining code to be clearer.
- Added comments to the functions in `math_utils.hpp` that are added with this PR
- Removed default parameter value for `mirror_matrix`'s `principal_axis` parameter. There is not really a justification why any of the axes should be the default. The user must be precise anyways. Also removed the parameter's `const` declaration.
@johannesugb
Copy link
Member

@stf976 Please have a look at the changed that I have pushed and see if you agree!

@stf976
Copy link
Collaborator Author

stf976 commented May 13, 2021

Changes look good. Shouldn't function arguments always be const if possible? I have already prepared documentation for the math_util functions as part of the API documentation, will update it when it is finished.

@johannesugb
Copy link
Member

Changes look good. Shouldn't function arguments always be const if possible? I have already prepared documentation for the math_util functions as part of the API documentation, will update it when it is finished.

Actually, const only makes sense for reference or pointer arguments to functions because it tells the user of the function that the passed value will not be modified.
However, arguments that are passed by value do not need to be const since a copy has been made anyways. Declaring by-value arguments const just takes away some (potential) flexibility for the implementation of the function. If the function wanted to overwrite the variable (for whatever reason) it could do so -- but only if the argument a.k.a. variable is non-const.

@johannesugb
Copy link
Member

johannesugb commented May 17, 2021

@stf976 There is one more issue:
Some image files fail to load. This can be reproduced easily by running the model_loader example.

It fails (in DEBUG mode!) in image_data.cpp, line 217 at the following assert:

assert(can_flip());

I think, the fix is trivial, because the code has actually no reason to go there. GLI fails to load a .png texture and still tries to flip, as far as I can tell.

Before re-requesting a review, please ensure that the following examples run fine:

  • compute_image_processing in DEBUG and in RELEASE mode
  • model_loader in DEBUG and in RELEASE mode
  • orca_loader in DEBUG and in RELEASE mode
  • ray_query_in_ray_tracing_shaders in DEBUG and in RELEASE mode
  • ray_tracing_with_shadows_and_ao in DEBUG and in RELEASE mode

If you don't have a ray tracing capable GPU, I'll test them before merging the PR.

@stf976
Copy link
Collaborator Author

stf976 commented May 17, 2021

@stf976 There is one more issue:
Some image files fail to load. This can be reproduced easily by running the model_loader example.

Fixed, the model_loader works again now. I also tested the other examples where possible, but don't have a GPU that supports RTX to test the last two.

@johannesugb johannesugb merged commit 08d4c97 into master May 18, 2021
@johannesugb johannesugb deleted the create_cubemap_from_file branch May 18, 2021 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants