mnowak
Topic Author
Posts: 4
Joined: 09 Jul 2025, 21:52

Appearance Effects require RenderContext

11 May 2026, 16:44

Hey all,
I'm trying to use Appearance -> Effects on Noesis elements. I'm not using the Application launcher nor RenderContext::Create() to create render devices. Instead I'm specifically creating a RenderDevice with the Factory methods to wrap my current device context. When I use any applied Appearance Effects, I get a crash that points at the RenderContext being null from EnsureShaders() from any Effects. Is there something obvious I'm missing to make sure this is setup correctly? It looks like creating a RenderContext involves using the RenderDevice factories and I don't want to create multiple render devices

Any help with be appreciated!
 
User avatar
jsantos
Site Admin
Posts: 4822
Joined: 20 Jan 2012, 17:18
Contact:

Re: Appearance Effects require RenderContext

12 May 2026, 01:22

Hello!

The shader architecture we offer in Noesis is totally open. The implementation decides what a shader is, how a shader is written, how a shader is compiled and how a shader is rendered. There is no API in the RenderDevice for creating shaders; the only information about the current shader ID is passed in the DrawBatch function. This current shaderID is the one your implementation decided to assign in every custom Brush or Effect.

In our Appplication Framework we offer an implementation spread in different parts:
  • We offer a command line offline compiler that uses HLSL and several defines for working on the rest of renderers.
  • The RenderContext is in charge of finding the right byte code for its renderer and sending the CreatePixelShader request to it.
  • Our shader samples (like for example the TintEffect) use the RenderContext for getting the ID that is later sent to every RenderDevice in DrawBatch.
So right now, you can’t use the custom shaders (Brush or Effects) in the App Framework without a valid RenderContext. Effects and Brushes themselves do not depend on it, but our sample implementation does. If you want to use our render devices (long term we recommend that you implement your own one), you will have to modify the App Framework code a bit to avoid the RenderContext for compiling the shaders and instead handle shader compilation yourself. If this only for a specific render device, the changes are quite easy, it should be a minor refactorization.

Because there is no virtual function for creating shaders in RenderDevice, the active RenderContext is used to handle this internally, since each RenderContext is aware of the concrete renderer implementation.

This is the current state at this point. It has been suggested a few times to extend the RenderDevice base class to support compiling shaders, but this would be too restrictive for many of the implementations our current clients have. But it is definitely something we can consider again.

Happy to get more feedback about this.

Who is online

Users browsing this forum: No registered users and 3 guests