Thoughts on making Cycles into a spectral renderer

Ah so it had to do with reroutes? Nice. That would explain why it only happened after I refactored the material so the node tree looks less of a mess

Uh…


Something is clearly wrong :smiley:


Also getting odd artifacts during rendering

1 Like

That’s interesting. I experienced similar artifacts when I was testing the build before uploading. I wasn’t able to reproduce them after I relaunched Blender. Maybe this has something to do with the recent GPU code refactoring.

So I checked once more to be sure. I changed a single line in my build script:
From:

git clone --single-branch --quiet -b spectral-cycles https://github.com/sobotka/blender.git

To:

git clone --single-branch --quiet -b master https://github.com/sobotka/blender.git

The master has no build issues. I will try searching for a source of the issue, but I am quite unfamiliar with the code and C++ in general.

Update: I didn’t find anything obvious. Possibly the __KERNEL_GPU__ switch activated or not activated somewhere? Really no idea :frowning:

What I know for sure: it must have occurred during the first three weeks of August. I compiled successfully on July 30 and then it failed on August 21.

https://developer.blender.org/T80327

4 Likes

I tried a Linux build myself just now and got a different error:

/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c: In function ‘ui_draw_but_CURVE’:
/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c:2122:7: error: a label can only be part of a statement and a declaration is not a statement
 2122 |       uint8_t white[3] = {0xFF, 0xFF, 0xFF};
      |       ^~~~~~~
/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c:2148:7: error: a label can only be part of a statement and a declaration is not a statement
 2148 |       uint8_t white[3] = {0xFF, 0xFF, 0xFF};
      |       ^~~~~~~
/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c:2182:7: error: a label can only be part of a statement and a declaration is not a statement
 2182 |       uint8_t unselected[3] = {0xFF, 0xFF, 0xFF};
      |       ^~~~~~~
/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c:2183:7: error: expected expression before ‘uint8_t’
 2183 |       uint8_t selected[3] = {0xFF, 0xA0, 0x28};
      |       ^~~~~~~
/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c:2185:45: error: ‘selected’ undeclared (first use in this function); did you mean ‘unselected’?
 2185 |       rgb_uchar_to_float(color_vert_select, selected);
      |                                             ^~~~~~~~
      |                                             unselected
/home/alistair/Software/blender/blender-spectral/blender/source/blender/editors/interface/interface_draw.c:2185:45: note: each undeclared identifier is reported only once for each function it appears in
source/blender/editors/interface/CMakeFiles/bf_editor_interface.dir/build.make:134: recipe for target 'source/blender/editors/interface/CMakeFiles/bf_editor_interface.dir/interface_draw.c.o' failed
make[3]: *** [source/blender/editors/interface/CMakeFiles/bf_editor_interface.dir/interface_draw.c.o] Error 1
make[3]: *** Waiting for unfinished jobs....

I fixed it by adding empty statements after the case labels, like so:

    case UI_GRAD_SPECTRUM: ;
      uint8_t white[3] = {0xFF, 0xFF, 0xFF};

I made a pull request on github

1 Like

I didn’t see the issue that @isolin had, but I don’t have an Optix-compatible GPU

Thanks to @alisealy’s changes, it also compiles on macOS again. However, I am also getting artifacts and glitches in various panels, as well as missing icons in toolbars and dialogs. It looks like the issue @Alaska mentioned (T80327) and also T80439.


blender_spectral_cycles_glitch_macos

Yeah definitely hoping for another build as soon as this issue is resolved

3 Likes

I made a new build for macOS including the recent changes and updates!

Issue T80327 is still not fixed completely, so if you see glitches and/or missing icons, relaunch Blender (works for me usually).

I also enabled support for NVIDIA CUDA, but I cannot test it. If you have a Mac with an NVIDIA graphics card, please check if everything works :slight_smile:

3 Likes

A new build is available on GraphicsAll with T80327 (UI glitches) fixed.

2 Likes

I’ve also compiled a new build for macOS.

CUDA support was not working apparently, so I tried it again. Feedback is appreciated!
(Edit: It doesn’t work. I’ll try it again in the near future on an older Mac system.)

I noticed a new bug in the Camera Response Function widget. After launching Blender, the curve does not show any handles. Clicking and dragging the curve causes the view to behave incorrectly (see screenshots below). This issue goes away when you add a new object and create a new material or when you switch to the “Shading” workspace.

Screen Shot 2020-09-11 at 16.40.31
Directly after launching Blender

Screen Shot 2020-09-11 at 16.40.41
After dragging the curve

Both of those bugs are from the master branch. There are no handles in other curve widgets as well.
image
The curve disappears after dragging because Blender merges handles that are close, but for some reason, it merges all but two. I’ll try to fix this one at some point.

1 Like

The OptiX build issue still remains.

A new build is available. Changes:

  • Fixed wavelength sampling with Sobol pattern issue
  • Updated Blender
10 Likes

The new build is also available for macOS on GraphicAll.

3 Likes

Nice to see that spectral rendering for Cycles is progressing. Maybe this could be the next technique to push Cycles rendering realism?

4 Likes

If it’s okay to ask here, I’d like to know if there is chance of this being merged to mainline blender anytime soon? I mean like late 2021 or early 2022 (blender 3.0-3.3 maybe?) or is this something that’s still many years off. If this is something that might not be implemented in the core blender, what will happen to the project then?

I just want to get an idea of what the state of project is, I’m not trying to annoy anyone, or push anyone to work faster or anything like that. If this is the wrong place to ask this I’m sorry.

7 Likes

Absolutely it’s okay to ask that here. I don’t think the core feature set is many years off being complete. If worked on consistently by a few knowledgeable developers, I think this could be ready next year. The decision of whether or not to merge this is still ultimately up to the Blender developers themselves since bringing on new code brings on new complexity and maintenance cost. I personally don’t have enough time and resources to dedicate to this in order to get it merged and to continue to develop new features at a reasonable pace by myself, but the contributions of @pembem22 have been absolutely fantastic, making it much more feasible that this could get merged some time. If any more developers are considering helping out, this could be ready relatively soon, I suspect.

Please don’t hold your breath waiting for it to be merged, but with some contributions and momentum, I’m sure we could get there.

18 Likes

A new build is available on GraphicAll. Changes:

  • Baking should work now
  • Updated Blender
7 Likes