]> git.tdb.fi Git - libs/gl.git/log
libs/gl.git
2 years agoPadding is required at the end of certain SPIR-V struct members
Mikko Rasa [Sun, 7 Nov 2021 13:59:13 +0000 (15:59 +0200)]
Padding is required at the end of certain SPIR-V struct members

If the member is is itself a struct or an array, the next member must not
begin before the next alignment boundary.

2 years agoChange max_lights to a fixed constant
Mikko Rasa [Sun, 7 Nov 2021 12:38:49 +0000 (14:38 +0200)]
Change max_lights to a fixed constant

2 years agoDisallow specialization constants in certain contexts
Mikko Rasa [Sun, 7 Nov 2021 12:32:33 +0000 (14:32 +0200)]
Disallow specialization constants in certain contexts

The initialization of a specialization constant must not use other
specialization constants.

Arrays sized by a specialization constant inside structures are broken
by design because member offsets in SPIR-V are required to be literals.
Changing the size through specialization would at best leave empty space
in the struct and at worst overlap other members.

2 years agoFix size calculation for GLSL arrays
Mikko Rasa [Sun, 7 Nov 2021 12:31:38 +0000 (14:31 +0200)]
Fix size calculation for GLSL arrays

2 years agoApply implicit conversion to return expressions in GLSL functions
Mikko Rasa [Sun, 7 Nov 2021 10:46:29 +0000 (12:46 +0200)]
Apply implicit conversion to return expressions in GLSL functions

2 years agoAdd unsigned integer types to Program reflection and ProgramData
Mikko Rasa [Sun, 7 Nov 2021 09:54:01 +0000 (11:54 +0200)]
Add unsigned integer types to Program reflection and ProgramData

2 years agoDisallow bool variables in shader interface blocks
Mikko Rasa [Sun, 7 Nov 2021 09:21:35 +0000 (11:21 +0200)]
Disallow bool variables in shader interface blocks

Although OpenGL allows them in uniform blocks, SPIR-V says they can't be
used with externally visible storage classes.

2 years agoHide the allow_gl_calls member of Mesh::Loader
Mikko Rasa [Sun, 7 Nov 2021 09:04:36 +0000 (11:04 +0200)]
Hide the allow_gl_calls member of Mesh::Loader

2 years agoRemove the deprecated srgb_conversion flag from Resources
Mikko Rasa [Sun, 7 Nov 2021 08:36:42 +0000 (10:36 +0200)]
Remove the deprecated srgb_conversion flag from Resources

By now it didn't even have any effect anymore

2 years agoUse asynchronous resource loading in desertpillars
Mikko Rasa [Sun, 7 Nov 2021 08:23:56 +0000 (10:23 +0200)]
Use asynchronous resource loading in desertpillars

2 years agoRe-export desertpillars textures using external data storage
Mikko Rasa [Sun, 7 Nov 2021 08:23:07 +0000 (10:23 +0200)]
Re-export desertpillars textures using external data storage

2 years agoAvoid incorrect access to VertexSetup while async loading Mesh
Mikko Rasa [Tue, 2 Nov 2021 11:36:06 +0000 (13:36 +0200)]
Avoid incorrect access to VertexSetup while async loading Mesh

2 years agoDon't use resource manager for builtin data
Mikko Rasa [Tue, 2 Nov 2021 11:32:33 +0000 (13:32 +0200)]
Don't use resource manager for builtin data

Detecting them by the underscore at the beginning of the name feels a
little dodgy, but it will do for now.

2 years agoExplicitly cast regex match to boolean
Mikko Rasa [Tue, 2 Nov 2021 11:13:41 +0000 (13:13 +0200)]
Explicitly cast regex match to boolean

2 years agoExport texture's mipmap levels as 1 if mipmaps are not used
Mikko Rasa [Tue, 2 Nov 2021 11:11:03 +0000 (13:11 +0200)]
Export texture's mipmap levels as 1 if mipmaps are not used

2 years agoExport raw texture data to a separate file
Mikko Rasa [Tue, 2 Nov 2021 11:02:14 +0000 (13:02 +0200)]
Export raw texture data to a separate file

2 years agoSupport loading raw texture data from an external file
Mikko Rasa [Tue, 2 Nov 2021 10:17:24 +0000 (12:17 +0200)]
Support loading raw texture data from an external file

This enables async loading of pixel formats not supported by standard
image files.

2 years agoUse default member initializers in async loaders
Mikko Rasa [Tue, 2 Nov 2021 08:47:31 +0000 (10:47 +0200)]
Use default member initializers in async loaders

3 years agoMove the whole-texture image call and raw data loading to base class
Mikko Rasa [Mon, 1 Nov 2021 12:42:49 +0000 (14:42 +0200)]
Move the whole-texture image call and raw data loading to base class

This reduces duplication in the loading code and promotes uniform
behaviour across the different texture classes.

3 years agoCombine the external_image functions in Texture::Loader
Mikko Rasa [Mon, 1 Nov 2021 11:50:20 +0000 (13:50 +0200)]
Combine the external_image functions in Texture::Loader

Since DataFile::Loader now supports bound arguments, it can be used to
set the srgb flag.

3 years agoReorder functions in Sampler
Mikko Rasa [Sat, 30 Oct 2021 21:12:22 +0000 (00:12 +0300)]
Reorder functions in Sampler

3 years agoFix the type of a location variable
Mikko Rasa [Sat, 30 Oct 2021 21:11:30 +0000 (00:11 +0300)]
Fix the type of a location variable

3 years agoAdd some checks for invalid arguments
Mikko Rasa [Sat, 30 Oct 2021 20:32:18 +0000 (23:32 +0300)]
Add some checks for invalid arguments

3 years agoMake the Limits struct more robust
Mikko Rasa [Sat, 30 Oct 2021 20:29:48 +0000 (23:29 +0300)]
Make the Limits struct more robust

3 years agoAdd missing implementation of RenderMethod::set_image_based_lighting
Mikko Rasa [Sat, 30 Oct 2021 20:02:51 +0000 (23:02 +0300)]
Add missing implementation of RenderMethod::set_image_based_lighting

3 years agoImprove material handling in RenderMethod
Mikko Rasa [Sat, 30 Oct 2021 20:02:39 +0000 (23:02 +0300)]
Improve material handling in RenderMethod

3 years agoAdd uint vector types to DataType
Mikko Rasa [Sat, 30 Oct 2021 20:01:38 +0000 (23:01 +0300)]
Add uint vector types to DataType

3 years agoRename "renderable" to "content" in Effects and Scenes
Mikko Rasa [Sat, 30 Oct 2021 19:59:09 +0000 (22:59 +0300)]
Rename "renderable" to "content" in Effects and Scenes

This name better describes the relationship.

3 years agoClean up some more unused things
Mikko Rasa [Sat, 30 Oct 2021 19:54:00 +0000 (22:54 +0300)]
Clean up some more unused things

3 years agoUpdate and improve documentation
Mikko Rasa [Sat, 30 Oct 2021 19:51:30 +0000 (22:51 +0300)]
Update and improve documentation

3 years agoUse size_t to store sizes of buffers and such
Mikko Rasa [Sat, 30 Oct 2021 19:25:15 +0000 (22:25 +0300)]
Use size_t to store sizes of buffers and such

Shader reflection data can stick to 32-bit sizes, since SPIR-V's
decorations only take 32-bit operands.

3 years agoUse a sorted vector in place of set for small data
Mikko Rasa [Sat, 30 Oct 2021 19:07:48 +0000 (22:07 +0300)]
Use a sorted vector in place of set for small data

Despite having worse algorithmic performance, cache effects make the
vector faster for total data size of up to about 8 kB (YMMV).

The GLSL compiler can keep its sets for now, I'll create a proper class
for this at some point.

3 years agoRemove the exclusion mechanism from Renderer
Mikko Rasa [Sat, 30 Oct 2021 18:35:15 +0000 (21:35 +0300)]
Remove the exclusion mechanism from Renderer

It was only ever used by EnvironmentMap, which can do the filtering
itself.  Removing it makes the rendering process more straightforward,
with less function calls.

3 years agoMove sigc::trackable base from View to WindowView
Mikko Rasa [Fri, 29 Oct 2021 09:49:52 +0000 (12:49 +0300)]
Move sigc::trackable base from View to WindowView

3 years agoExplicitly specify enum values which are relied upon
Mikko Rasa [Fri, 29 Oct 2021 09:49:10 +0000 (12:49 +0300)]
Explicitly specify enum values which are relied upon

3 years agoUse default member initializers in some more classes
Mikko Rasa [Fri, 29 Oct 2021 09:48:39 +0000 (12:48 +0300)]
Use default member initializers in some more classes

3 years agoMove Bufferable::refresh_async's definition to the header
Mikko Rasa [Fri, 29 Oct 2021 09:23:32 +0000 (12:23 +0300)]
Move Bufferable::refresh_async's definition to the header

3 years agoRemove some unused and unnecessary things
Mikko Rasa [Fri, 29 Oct 2021 09:22:52 +0000 (12:22 +0300)]
Remove some unused and unnecessary things

3 years agoMake it an error to try to refresh a Bufferable without a buffer
Mikko Rasa [Fri, 29 Oct 2021 09:11:37 +0000 (12:11 +0300)]
Make it an error to try to refresh a Bufferable without a buffer

3 years agoAssign unneeded values to _ when unpacking
Mikko Rasa [Wed, 20 Oct 2021 13:06:22 +0000 (16:06 +0300)]
Assign unneeded values to _ when unpacking

3 years agoAdd an include path option to the command-line shader compiler
Mikko Rasa [Wed, 20 Oct 2021 13:05:01 +0000 (16:05 +0300)]
Add an include path option to the command-line shader compiler

3 years agoAdd debug names to things in viewer
Mikko Rasa [Wed, 20 Oct 2021 13:02:05 +0000 (16:02 +0300)]
Add debug names to things in viewer

3 years agoUpdate desertpillars to define more things in Blender
Mikko Rasa [Wed, 20 Oct 2021 12:33:36 +0000 (15:33 +0300)]
Update desertpillars to define more things in Blender

3 years agoAdd functions to retrieve steps and postprocessors from Sequence
Mikko Rasa [Wed, 20 Oct 2021 12:31:22 +0000 (15:31 +0300)]
Add functions to retrieve steps and postprocessors from Sequence

3 years agoMake it possible to set up and export some common effects in Blender
Mikko Rasa [Wed, 20 Oct 2021 12:04:44 +0000 (15:04 +0300)]
Make it possible to set up and export some common effects in Blender

A sky effect can now be enabled in world properties.  If sky is enabled
and any materials use IBL, en environment map effect is added.  If any
lights have shadows enabled, a shadow map effect is exported.

3 years agoStore prototype reference instead of just name in scene instances
Mikko Rasa [Wed, 20 Oct 2021 12:03:23 +0000 (15:03 +0300)]
Store prototype reference instead of just name in scene instances

3 years agoRefactor some parts of the Blender exporter to improve reusability
Mikko Rasa [Wed, 20 Oct 2021 11:59:42 +0000 (14:59 +0300)]
Refactor some parts of the Blender exporter to improve reusability

3 years agoSupport effects and subordinate sequences inside sequence templates
Mikko Rasa [Tue, 19 Oct 2021 13:02:57 +0000 (16:02 +0300)]
Support effects and subordinate sequences inside sequence templates

3 years agoRearrange postprocessor creation code in SequenceBuilder
Mikko Rasa [Tue, 19 Oct 2021 12:38:09 +0000 (15:38 +0300)]
Rearrange postprocessor creation code in SequenceBuilder

Previously it would have inadvertently deleted overridden postprocessors.

3 years agoRequire all renderables to be present when building a sequence
Mikko Rasa [Tue, 19 Oct 2021 12:00:38 +0000 (15:00 +0300)]
Require all renderables to be present when building a sequence

3 years agoUse shared actions in SequenceTemplate loaders
Mikko Rasa [Tue, 19 Oct 2021 09:46:39 +0000 (12:46 +0300)]
Use shared actions in SequenceTemplate loaders

3 years agoRefactor the structure of sequence template files
Mikko Rasa [Tue, 19 Oct 2021 09:36:53 +0000 (12:36 +0300)]
Refactor the structure of sequence template files

Renderables are now specified separately from steps.  Post-processors are
defined with a unified keyword, with the type determined by a statement
inside the block.

3 years agoAdd Renderable as base class for relevant types in Resources
Mikko Rasa [Tue, 19 Oct 2021 09:12:02 +0000 (12:12 +0300)]
Add Renderable as base class for relevant types in Resources

3 years agoRestore missing private access specifier
Mikko Rasa [Sun, 17 Oct 2021 20:18:36 +0000 (23:18 +0300)]
Restore missing private access specifier

It got accidentally removed in 9a63244.

3 years agoRefactor owned postprocessors in Sequence into a more generic mechanism
Mikko Rasa [Sun, 17 Oct 2021 08:26:13 +0000 (11:26 +0300)]
Refactor owned postprocessors in Sequence into a more generic mechanism

3 years agoSet a sane default value for ground albedo in Sky::Planet
Mikko Rasa [Sat, 16 Oct 2021 16:09:47 +0000 (19:09 +0300)]
Set a sane default value for ground albedo in Sky::Planet

3 years agoAdd a moving point light to the night phase of desertpillars
Mikko Rasa [Sat, 16 Oct 2021 16:01:44 +0000 (19:01 +0300)]
Add a moving point light to the night phase of desertpillars

3 years agoRe-export desertpillars data
Mikko Rasa [Sat, 16 Oct 2021 15:56:56 +0000 (18:56 +0300)]
Re-export desertpillars data

3 years agoAdd a day-night cycle to the desertpillars demo
Mikko Rasa [Sat, 16 Oct 2021 15:53:53 +0000 (18:53 +0300)]
Add a day-night cycle to the desertpillars demo

3 years agoTweak the logic in sky raymarching to avoid false shadowing
Mikko Rasa [Sat, 16 Oct 2021 15:34:15 +0000 (18:34 +0300)]
Tweak the logic in sky raymarching to avoid false shadowing

Ray_sphere_intersection now always returns the ingoing hit if radius is
positive or outgoing hit if radius is negative.  This avoids a ray
starting at ground level towards the sky immediately hitting the ground.

3 years agoAdjust function names in the GLSL compiler test runner
Mikko Rasa [Sat, 16 Oct 2021 13:55:38 +0000 (16:55 +0300)]
Adjust function names in the GLSL compiler test runner

Make them match the changes in d1e4737.

3 years agoDon't record references to null declarations
Mikko Rasa [Sat, 16 Oct 2021 13:53:21 +0000 (16:53 +0300)]
Don't record references to null declarations

3 years agoSave possible outer reference when entering subscript
Mikko Rasa [Sat, 16 Oct 2021 13:49:44 +0000 (16:49 +0300)]
Save possible outer reference when entering subscript

Otherwise it gets corrupted and the outer variable may be incorrectly
removed if nothing else refers to it.

3 years agoRecognize additional blend types in the Blender exporter
Mikko Rasa [Sat, 16 Oct 2021 12:54:11 +0000 (15:54 +0300)]
Recognize additional blend types in the Blender exporter

3 years agoAdd blend statement also with custom shaders
Mikko Rasa [Sat, 16 Oct 2021 12:51:11 +0000 (15:51 +0300)]
Add blend statement also with custom shaders

3 years agoRemove an unnecessary if
Mikko Rasa [Sat, 16 Oct 2021 12:43:38 +0000 (15:43 +0300)]
Remove an unnecessary if

The condition is already checked at the outer level

3 years agoRecognize transparent materials in Blender and export them accordingly
Mikko Rasa [Sat, 16 Oct 2021 10:11:49 +0000 (13:11 +0300)]
Recognize transparent materials in Blender and export them accordingly

Objects with transparency are exported into a separate, Z-sorted
sub-scene.

3 years agoRefactor scene export to use inline scenes instead of a wrapper scene
Mikko Rasa [Sat, 16 Oct 2021 09:29:32 +0000 (12:29 +0300)]
Refactor scene export to use inline scenes instead of a wrapper scene

3 years agoRemove the scene type property from Blender exporter
Mikko Rasa [Sat, 16 Oct 2021 09:10:20 +0000 (12:10 +0300)]
Remove the scene type property from Blender exporter

It's better managed automatically based on object transparency and other
factors.

3 years agoMove blend state from Sequence::Step to RenderMethod
Mikko Rasa [Sat, 16 Oct 2021 08:49:11 +0000 (11:49 +0300)]
Move blend state from Sequence::Step to RenderMethod

Even though all blended objects are typically rendered in a single step,
it may be desirable to use different blend modes for different objects.

3 years agoWrap material before passing it to create_technique_resource
Mikko Rasa [Sat, 16 Oct 2021 08:21:38 +0000 (11:21 +0300)]
Wrap material before passing it to create_technique_resource

3 years agoSimplify exporter creation
Mikko Rasa [Sat, 16 Oct 2021 08:12:29 +0000 (11:12 +0300)]
Simplify exporter creation

Since options are no longer set as instance variables, the helper
functions feel unnecessary.

3 years agoRecognize a node graph which gives transparency to unlit materials
Mikko Rasa [Fri, 15 Oct 2021 10:48:19 +0000 (13:48 +0300)]
Recognize a node graph which gives transparency to unlit materials

3 years agoSupport inline scenes within other scenes
Mikko Rasa [Thu, 14 Oct 2021 09:02:37 +0000 (12:02 +0300)]
Support inline scenes within other scenes

This is useful for creating scenes where transparent objects are rendered
after opaque ones, without the entire scene being Z-sorted.

3 years agoAdjust naming of instances in Scene loader
Mikko Rasa [Thu, 14 Oct 2021 09:00:27 +0000 (12:00 +0300)]
Adjust naming of instances in Scene loader

I'm going to add inline nested scenes so a per-loader counter would get
duplicates.

3 years agoReplace the instance variables of exporters by function parameters
Mikko Rasa [Wed, 13 Oct 2021 16:34:25 +0000 (19:34 +0300)]
Replace the instance variables of exporters by function parameters

This is more flexible when exporting a lot of data.  In almost all cases
the variables were only used by the export_to_file function anyway.

3 years agoRespect enabled_methods in the Sky effect
Mikko Rasa [Wed, 13 Oct 2021 09:28:10 +0000 (12:28 +0300)]
Respect enabled_methods in the Sky effect

3 years agoRename Effect::enabled_passes to enabled_methods
Mikko Rasa [Wed, 13 Oct 2021 09:26:36 +0000 (12:26 +0300)]
Rename Effect::enabled_passes to enabled_methods

3 years agoAdjust and re-export desertpillars data with new features
Mikko Rasa [Mon, 11 Oct 2021 13:52:11 +0000 (16:52 +0300)]
Adjust and re-export desertpillars data with new features

3 years agoChange default binding ranges to match lowest OpenGL standard
Mikko Rasa [Mon, 11 Oct 2021 13:45:10 +0000 (16:45 +0300)]
Change default binding ranges to match lowest OpenGL standard

3 years agoAdjust GLSL features factory function names
Mikko Rasa [Mon, 11 Oct 2021 13:27:46 +0000 (16:27 +0300)]
Adjust GLSL features factory function names

Make it clear these functions deal with OpenGL versions.

3 years agoFix incorrect exception messages
Mikko Rasa [Mon, 11 Oct 2021 13:25:41 +0000 (16:25 +0300)]
Fix incorrect exception messages

3 years agoFix export of the stub technique
Mikko Rasa [Mon, 11 Oct 2021 13:20:43 +0000 (16:20 +0300)]
Fix export of the stub technique

3 years agoMinor cleanups and tweaks
Mikko Rasa [Mon, 11 Oct 2021 13:20:11 +0000 (16:20 +0300)]
Minor cleanups and tweaks

3 years agoClear reflect data before adding shader stages
Mikko Rasa [Mon, 11 Oct 2021 13:17:27 +0000 (16:17 +0300)]
Clear reflect data before adding shader stages

Otherwise it prevents the number of clip distances from being recorded.

3 years agoAdd tetrahedron shadow maps for point lights
Mikko Rasa [Mon, 11 Oct 2021 13:14:00 +0000 (16:14 +0300)]
Add tetrahedron shadow maps for point lights

3 years agoApply shadow depth bias in a different way
Mikko Rasa [Mon, 11 Oct 2021 13:05:16 +0000 (16:05 +0300)]
Apply shadow depth bias in a different way

It cannot be properly applied through the matrix for perspective
projection.

3 years agoRefactor ShadowMap to allow different types of lights
Mikko Rasa [Mon, 11 Oct 2021 12:57:50 +0000 (15:57 +0300)]
Refactor ShadowMap to allow different types of lights

Omnidirectional lights will need more than one view per light.

3 years agoSuppoer per-light shadow casters in ShadowMap
Mikko Rasa [Mon, 11 Oct 2021 12:40:22 +0000 (15:40 +0300)]
Suppoer per-light shadow casters in ShadowMap

Different types of lights may require different shaders for rendering
shadow maps, or it may be desirable to use different occluder geometry
for far away lights than close ones.

3 years agoAllow suppressing clear in a sequence by passing in a special tag
Mikko Rasa [Mon, 11 Oct 2021 12:25:52 +0000 (15:25 +0300)]
Allow suppressing clear in a sequence by passing in a special tag

Sequence doesn't pass on the tag it receives, so it can be used to
control the sequence's own behaviour instead.

3 years agoSupport creating fully custom techniques in Blender
Mikko Rasa [Mon, 11 Oct 2021 11:55:02 +0000 (14:55 +0300)]
Support creating fully custom techniques in Blender

This replaces the custom shader, which was getting unwieldy with
different kinds of shadow maps needing different shaders.

3 years agoAllow redeclaring entire builtin interface blocks
Mikko Rasa [Sun, 10 Oct 2021 15:35:43 +0000 (18:35 +0300)]
Allow redeclaring entire builtin interface blocks

3 years agoRemove generic clipping state
Mikko Rasa [Sun, 10 Oct 2021 14:08:42 +0000 (17:08 +0300)]
Remove generic clipping state

Instead do things the Vulkan way and set the enabled clip planes based on
the declared size of the gl_ClipDistance array in the shader.

3 years agoReflect builtin decorators from SPIR-V modules
Mikko Rasa [Sun, 10 Oct 2021 14:03:02 +0000 (17:03 +0300)]
Reflect builtin decorators from SPIR-V modules

3 years agoRefactor the builtin occluder shader
Mikko Rasa [Sun, 10 Oct 2021 13:09:10 +0000 (16:09 +0300)]
Refactor the builtin occluder shader

It's now stored in shaderlib and considered available for custom shaders
to import.

3 years agoMove the frag_color output from msp_interface to common
Mikko Rasa [Sun, 10 Oct 2021 12:50:43 +0000 (15:50 +0300)]
Move the frag_color output from msp_interface to common

This allows creating shaders without a fragment stage which use the
interface.

3 years agoDecorate builtin variables in the global scope
Mikko Rasa [Sun, 10 Oct 2021 12:48:46 +0000 (15:48 +0300)]
Decorate builtin variables in the global scope

3 years agoRemove output variables which are not referenced
Mikko Rasa [Sun, 10 Oct 2021 12:37:07 +0000 (15:37 +0300)]
Remove output variables which are not referenced

3 years agoSupport redeclaring builtins defined in an interface block
Mikko Rasa [Sun, 10 Oct 2021 11:49:59 +0000 (14:49 +0300)]
Support redeclaring builtins defined in an interface block

3 years agoRemove support for redeclaring user-defined variables
Mikko Rasa [Sun, 10 Oct 2021 11:40:52 +0000 (14:40 +0300)]
Remove support for redeclaring user-defined variables

... with the exception of redeclaring a previously unsized array.
Builtin array sizes can also now be redeclared.