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 light-map SDK example #16

Open
Dawoodoz opened this issue Jul 30, 2020 · 4 comments
Open

Create light-map SDK example #16

Dawoodoz opened this issue Jul 30, 2020 · 4 comments
Labels
good first issue Good for newcomers

Comments

@Dawoodoz
Copy link
Owner

The use of light-maps in the Cube example is quite ugly, because the secondary texture layer is generic rather than a baked light-map for the model. Importing levels with light-maps from an existing tool or creating light-maps dynamically would allow creating a much better example together with documentation of the workflow.

@Dawoodoz Dawoodoz added the good first issue Good for newcomers label Jul 30, 2020
@Dawoodoz
Copy link
Owner Author

Dawoodoz commented Aug 5, 2020

Extending the PLY importer from the Sandbox tool to include textures would make this reasonably easy.

@Dawoodoz
Copy link
Owner Author

Dawoodoz commented Apr 15, 2023

Tried real-time shading to textures together with normal maps and specular light, and it can do the shading smoothly on background threads using swap chains while rendering. Because texture interpolation is the heavy part and aligned 2D filters are fast, using high-resolution lightmaps combined into the same image as the diffuse material colors is both faster and better looking. Maybe this can be used as the high quality setting with realtime specular light up close and then just passively update diffuse light of nearby rooms in a low setting for laptops.

@Dawoodoz
Copy link
Owner Author

This would be a good place for testing new occlusion shapes in complex scenes with large moving occluding objects.

@Dawoodoz
Copy link
Owner Author

There is already functions for generating normal and position maps for polygon models, and lightmaps from normal and position maps, but generating UV2 coordinates still needs an automatic unwrapping algorithm to simplify the workflow.

Once normal and position maps are generated from smoothed vertex normals for a highly detailed model, one can apply a polygon reduction algorithm for displaying it from far away using the same normal map. The highly detailed asset could also be excluded from the final game to save space.

Static instances of a model could pre-transform their own normal and position maps, used to generate both a static and a dynamic lightmap. Dynamic instances do matrix transforms while updating lightmaps.

Very large surfaces in outdoor scenes could use blend maps to avoid wasting space on large lightmaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant