Robot Graffiti Posted March 2 Share Posted March 2 (edited)     // Summary:     //   Gets the source image to use with Direct2D.     //     // Remarks:     //   You should only retrieve this image if it will actually be used for rendering,     //   as it will consume GPU memory once initialized.     //   This is equivalent to:     //   this.Environment.Document.Layers[this.Environment.SourceLayerIndex].Image  Should I be concerned about this? If I want to pass the current layer into a shader, is this the right way to get it, or is there some other, better way?  SrgbToLinearEffect background = new(dc); background.Properties.Input.Set(Environment.SourceImage);  Edited March 2 by Robot Graffiti Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 2 Share Posted March 2 That's exactly how you use it   Where you mostly need to be concerned is when you're using multiple layer images from this.Environment.Document.Layers[i].Image. You shouldn't grab all of the layer images, you should only grab exactly the layer images you need for rendering based on the property values in the token (from the UI). If an image only has a few layers, it's probably not a big deal. But if the image has 100 layers (which is not uncommon), you might run into trouble. 1 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.