-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
These lines of code for OnInitializeRenderInfo() are only generated when building the DLL (they show up in the source!).
This means preview rendering will always use Input/OutputAlphaMode of Premultiplied, and ColorContext of WorkingSpaceLinear.
Here's an example. If you remove the // Working Space Color Context, it should look different. But, it doesn't -- not when you're inside of CodeLab anyway. Works fine after you build the DLL and run it that way. I verified that the ColorContext isn't being set by stepping through the debugger
First is the original, Second is how it looks in CodeLab (preview rendering), Third is how it looks when you Build and run it through the Effects menu
// Working Space Color Context
#region UICode
#endregion
protected override IDeviceImage OnCreateOutput(IDeviceContext deviceContext)
{
RectFloat sourceBounds = deviceContext.GetImageLocalBounds(Environment.SourceImage);
Point2Float sourceCenter = sourceBounds.Center;
IDeviceImage input = Environment.SourceImage;
///////////////////////////////////////////////////////////////////////////////
// Uncomment this line and the line before `return` to show how it should look
// if the ColorContext were being initialized correctly
//input = new SrgbToLinearEffect(deviceContext, input);
///////////////////////////////////////////////////////////////////////////////
IDeviceImage output = new GaussianBlurMapEffect(deviceContext).Initialize(e =>
{
e.Properties.Input.Set(input);
e.Properties.StandardDeviationMap.Set(
new HlslBinaryOperatorEffect(
deviceContext,
new HlslBinaryFunctionEffect(
deviceContext,
HlslBinaryFunction.Distance,
new ScenePositionEffect(deviceContext),
new Vector4Float((Vector2Float)sourceCenter, Vector2Float.Zero)),
HlslBinaryOperator.Multiply,
new Vector4Float((float)(1.0 / (Math.Max(sourceBounds.Width, sourceBounds.Height) / 2.0)))));
e.Properties.MaxStandardDeviation.SetValue(300);
e.Properties.StandardDeviationLevels.SetValue(3);
});
///////////////////////////////////////////////////////////////////////////////
// Uncomment this line and the line above to show how it should look if the
// ColorContext were being initialized correctly
//output = new LinearToSrgbEffect(deviceContext, output);
///////////////////////////////////////////////////////////////////////////////
return output;
}Metadata
Metadata
Assignees
Labels
No labels


