Commit Graph

59 Commits

Author SHA1 Message Date
Philip Rideout
14e1bbdf3d Add --linear to mipgen. 2018-09-19 12:28:50 -07:00
Ben Doherty
29e891a7b1 Tungsten: add IBL to the preview panel (#254)
* Move preview-specific files into new package

* Add venice_sunset resource

* Load IBL from resources

* Generate IBL at build time
2018-09-19 11:16:58 -07:00
Ben Doherty
2218c51306 Add color space option to texture chooser (#266) 2018-09-19 11:02:28 -07:00
Romain Guy
0d37989157 Make the procedural UV grid HDR (#265) 2018-09-18 18:28:56 -07:00
Philip Rideout
fd8b1851a9 Add --grayscale option to mipgen.
By using single-component images instead of RGB, we are greatly reducing
the size of KTX files for roughness, metallic, and ambient occlusion.
2018-09-18 16:46:38 -07:00
Philip Rideout
60c4822884 Fix mipgen issue where mip 0 was missing from KTX.
The libimage API does not include the original image in the returned mip
array, which might make sense when generating individual files, but for
a KTX bundle, we want to include level 0.
2018-09-18 15:13:35 -07:00
prideout
52ee8e570d mipgen can now generate KTX files.
I tested the validity of the resulting KTX files by using macOS Preview,
which can read some types of KTX files. (!)

This CL also adds mipgen to the WebGL build, although its outputs are
not yet used by the sample apps.
2018-09-18 12:42:47 -07:00
Mathias Agopian
944cce7935 Assume V=1 when prefiltering the environement
It looks like assuming V=1 during prefiltering
yields to better results. This is quite subtle.
2018-09-18 01:40:55 -07:00
Mathias Agopian
094453dad8 clarify the LOD -> linear_roughness remapping
This remapping can be confused with roughness, because

linear_roughness = roughness*roughness and 
lod = sqrt(linear_roughness)

so the value of lod is roughness, but conceptually
it’s not.
2018-09-17 20:18:57 -07:00
Ben Doherty
cc77160cb4 Tungsten: fix a couple view-related bugs (#255)
* Fix bug when dragging non-selected node

* Fix bug when dragging nodes
2018-09-17 16:16:15 -06:00
prideout
cc6ee64e05 Add "strip alpha" feature to mipgen.
Sometimes the source image might have a useless 1-bit alpha channel
which our image-processing pipeline expands into a proper alpha channel.
This consumes memory and breaks an assertion in our encoder.

I ran into this while testing mipgen with the Suzanne textures.
2018-09-17 15:08:09 -07:00
prideout
3f751f3850 cmgen and mipgen should return an error code upon failure.
These tools can be used in an asset pipeline; build scripts should not
be required to parse stdout in order to determine success.
2018-09-17 14:51:29 -07:00
Romain Guy
4ca4df0f6c Inlude missing headers (#252) 2018-09-17 09:31:10 -07:00
Mathias Agopian
71fed25775 When prefiltering the IBL we were wrongly assuming
f90=0, which is nonsensical.

We now assume f0=f90=1, meaning the fresnel term
always evaluates to 1.

Thankfully this didn’t impact the prefilter too much.


IBLs MUST BE REGENERATED
2018-09-16 17:40:11 -07:00
Ben Doherty
3e6f1a2c39 Tungsten: add orbit cam manipulator (#244)
* Add orbit cam to Tungsten

* Add kotlin-math library

* Flip mouse wheel event sign if coming from a physical wheel
2018-09-13 17:30:33 -07:00
Mathias Agopian
ea91002412 improve cmgen comments about IBL (#243)
* better comments on calculating the DFG lookup tables

* add comments about computing the “LD” term

* add comments about computing IBL diffuse pre-integration

* be clearer about the determinant of the jacobian
2018-09-13 15:12:45 -07:00
Ben Doherty
6ab36e9365 Fix, flip components not working (#239) 2018-09-12 17:29:40 -07:00
Ben Doherty
d0be29fb34 Tungsten: introduce texture sample node (#230)
* Tungsten: introduce texture sample node

* Add uv input to texture sample node

* Only flip components if specified in reverse order
2018-09-12 10:37:03 -07:00
Pixelflinger
1db1426260 fix cmgen unit test 2018-09-11 01:09:22 -07:00
Mathias Agopian
4475cbaf2e fold the lambert brdf into the SH coefs
this saves one multiply in the shader, but most
importantly makes the first SH coefficient a
color and reduces its range

ALL IBLs NEED TO BE REGENERATED using cmgen
2018-09-10 21:09:11 -07:00
Mathias Agopian
abae178ddc cmgen: option to generate the diffuse irradiance
-—ibl-irradiance generates the diffuse irradiance as
a cubemap using importance sampling. 
It can be used in place of the SH version (—-sh-irradiance)
which sometimes presents some ringing artifacts.
2018-09-07 14:31:44 -07:00
Mathias Agopian
f75f19edd0 save debug files in .HDR format instead of .PNG 2018-09-07 14:31:44 -07:00
Mathias Agopian
ad18b6ea39 fix divide-by-zero in cmgen (#201) (#218)
We were doing a divide-by-zero in a case where
the result wasn’t used.
2018-09-06 20:42:45 -07:00
Ben Doherty
069b4d1180 Tungsten: improvements to shader node (#216)
* Add StringValue and Choice

* Add editorFactory to nodes

* Update graph model when compiling

* Extract compileNode function

* Change inputs based on shadingModel

* Allow nodes to set shading model

* Fix float literals with dimension 1

* Adjust node height for slots

* Improvements to shader node

* Don't ever set a default value

* Add anisotropy and anisotropyDirection
2018-09-06 17:20:55 -07:00
Ben Doherty
7575bcee6e Tungsten: introduce custom view rendering (#205)
* Auto-convert MaterialGraphComponent to Kotlin

* Introduce new view rendering

* Add expressionMap to graph

* Show data width on slots

* Compile all nodes when compiling, even unconnected nodes

* Remove old views
2018-09-05 12:03:34 -07:00
Tim van Scherpenzeel
963342c7cc fix minor error in spelling of stitch (#204) 2018-09-05 12:03:09 -07:00
Romain Guy
1c42a122c9 Fix cubemap mirroring (#203) 2018-09-05 11:46:31 -07:00
Romain Guy
91279fa818 Exclude comments from brace parsing in vertex/fragment blocks (#200)
* Exclude comments from brace parsing in vertex/fragment blocks

If a comment contained an opening brace { but not the matching
closing one, matc would not count braces properly and not find
the proper end of a vertex/fragment block.

* Add test
2018-09-04 12:03:16 -07:00
Romain Guy
0a8fad46fe Fix typos 2018-09-04 10:27:15 -07:00
Ben Doherty
bef9a9d2c4 Tungsten: introduce handling for varying dimensionality (#191)
* Introduce dimensions to Expression

* Rename to setExpressionForSlot and add redComponent function

* Add Expression helpers to aid with differing data widths

* Add Float2ConstantNode

* Single-line functions when possible
2018-08-31 18:16:57 -07:00
Romain Guy
4002498438 Add new HDR environment maps in third_party (#182)
These are much better than the ones we had in assets/
2018-08-29 14:22:58 -07:00
Ben Doherty
3282fc7984 Introduce property serialization (#175) 2018-08-28 16:01:59 -07:00
Ben Doherty
276e48fdeb Tungsten: add material parameters editing (#156) 2018-08-27 20:54:30 -07:00
Romain Guy
33c44ee9ce Install BlueGL (#148)
* Add READMEs to install packages

* Don't install BlueVK headers, install BlueGL lib
2018-08-27 08:50:35 -07:00
Ben Doherty
95fb7ae0ab Tungsten: prep for material parameters editing (#141) 2018-08-25 10:25:51 -07:00
Ben Doherty
2874897dc1 Tungsten: use single-line functions where possible (#144) 2018-08-24 17:18:21 -07:00
Romain Guy
4585b8f896 Add clearCoatNormal property (#131)
* Add clear coat normal map support

This change allows to set a separate normal map for the clear coat layer of a material.

* Document the new clearCoatNormal property

* Fix typo
2018-08-24 08:56:44 -07:00
Ben Doherty
6b435a0e8e Tungsten: rework model to be immutable (#127) 2018-08-23 16:35:07 -07:00
Philip Rideout
aa518369b4 Move deprecated Image out of libs. (#125)
This moves the old Image class into cmgen because it is the only client
that still uses it. We can migrate cmgen to LinearImage in the future.
2018-08-23 10:19:02 -07:00
Philip Rideout
e45e7b256d Introduce mipgen frontend. (#120)
* Introduce mipgen frontend.

For now this is fairly simple although it does let you choose a filter.
Another cool feature is that an HTML file is generated which makes it
easy to review the generated miplevels.

This does not expose the Boundary enum to users because it has not yet
been implemented in the core Image library.

* Fix up mipgen per code review.
2018-08-21 17:54:27 -07:00
Philip Rideout
07e4db795f Remove lots of reinterpret_cast. (#112)
* Remove lots of reinterpret_cast.

* Improve terseness with auto.
2018-08-17 12:01:32 -07:00
Philip Rideout
044387308a Migrate imageio to LinearImage. (#111) 2018-08-17 11:22:05 -07:00
Romain Guy
f3e0137c2b Fix misguiding comments in the docs 2018-08-16 18:25:10 -07:00
Romain Guy
3b110e3774 Fix uninitialized vectors in envmap processing 2018-08-16 14:56:00 -07:00
Romain Guy
58520d7d32 Add spherical harmonics extraction test (#105)
We use a white furnace to test that spherical harmonics are properly computed.
2018-08-16 14:35:12 -07:00
Philip Rideout
6d9668ccf6 Add unit test for cross cube images. (#101) 2018-08-15 15:36:17 -07:00
Romain Guy
9f2592ed9d Update SPIRV libraries (#99)
* Update SPIRV libraries

- Update `spirv-cross`
- Update `spirv-tools`
- Update `glslang`

`spirv-tools` contains a fix for an issue we reported (unnecessary promotions to highp in certain expressions).

* Add SPIRV-Tools dependency to matinfo
2018-08-15 12:59:17 -07:00
Romain Guy
b739ac8e86 Fold computations inside the branch 2018-08-14 18:15:01 -07:00
Philip Rideout
b5b90b83f8 Add test_cmgen and promote the "updateOrCompare" function. (#95) 2018-08-14 13:47:31 -07:00
shartte
e6d5a85ec8 clang-cl warning fixes (#83)
* Disable certain MSVC-specific deprecation warnings

* clang-cl.exe warning fixes
2018-08-14 12:55:04 -07:00