public ShaderData(string pixelShaderPath, Texture dataSurface, TextureTransparency transparency) { if (ShaderData.IsSupported) { ArchivedFile archivedFile = Engine.FileManager.GetArchivedFile("play/shaders/" + pixelShaderPath); if (archivedFile != null) { using (Stream stream = archivedFile.Download()) { try { byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, buffer.Length); using (ShaderBytecode shaderBytecode = new ShaderBytecode(buffer)) this._pixelShader = new PixelShader(Engine.m_Device, shaderBytecode); } catch (Exception ex) { Debug.Error(ex); } } } this._dataSurface = dataSurface; } this._transparency = transparency; }
public ShaderData(PixelShader pixelShader, Texture dataSurface, TextureTransparency transparency) { if (ShaderData.IsSupported) { this._pixelShader = pixelShader; this._dataSurface = dataSurface; } this._transparency = transparency; }