three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Nodes: RenderOutputNode name change

Open WestLangley opened this issue 1 year ago • 1 comments
trafficstars

Description

RenderOutputNode converts scene-referred linear light values to display-referred code values, and then converts the code value to a color space appropriate for the display.

The current name is derived from OutputPass, but I think we can do better.

Solution

I suggest the following nomenclature changes:

  1. RenderOutputNode => DisplayNode, DisplayViewNode, or ViewNode
  2. export const renderOutput => display, displayView, or view

Given that the transforms in this node are specific to a display, it seems reasonable to include Display in the name.

A "view", I believe, can include additional post-processing. That may be appropriate if the node were to include other optional transforms at some point.

//

For clarity, this is the current nomenclature:

scenePass.setMRT( mrt( {
	output: output,
	...
} ) );

const outputPass = scenePass.getTextureNode( 'output' );

postProcessing.outputNode = outputPass.renderOutput();

I recommend this nomenclature:

scenePass.setMRT( mrt( {
	output: output,
	...
} ) );

const outputPass = scenePass.getTextureNode( 'output' );

const viewPass = outputPass.displayView();

postProcessing.outputNode = viewPass;

Alternatives

None.

Additional context

No response

WestLangley avatar Aug 18 '24 04:08 WestLangley

TBH, I find the output nomenclature appropriate.

If you want to change to display, you have to do this uniformly at least for the WebGPURenderer related code. So for example Renderer.outputColorSpace should be Renderer.displayColorSpace.

But right now, I don't see enough arguments to go through all these name changes.

Mugen87 avatar Aug 18 '24 09:08 Mugen87

I'm not opposed to a change, but I'm having trouble convincing myself of the improvement.

Perhaps worth noting, the closest term in WebGL would be gl.drawingBufferColorSpace, and in WebGPU that's GPUCanvasConfiguration#colorSpace. In neither case is it necessarily representative of the display or view. The browser or OS may apply additional mappings, or the application may intend to do something else with the canvas. So I'm nervous of committing to display/view terminology in these lower-level APIs. In an application like the three.js Editor, the terms "Display" or "View" would seem entirely appropriate.

donmccurdy avatar Sep 15 '24 16:09 donmccurdy

Closing since the display or view notation did not get enough support. Let's stick to the current nomenclature for now.

Mugen87 avatar Sep 28 '24 08:09 Mugen87