What is the exact meaning for "Renderer" in programming? [closed]

Can anyone please tell me what is the word "Renderer" actually mean?

For example, in Xamarin.Forms, the most used concept is "Custom Renderer". Since there are many meanings available for Renderer based on the different fields, I couldn't get the exact meaning of Renderer in programming. So, any clear solution available?

Thanks in advance.

1

4 Answers

In computer graphics (which includes less elaborate graphics like a simple form in a window), rendering refers to the act of drawing the modelled objects on screen.

In your program's memory, the button for your dialog is not an image that you literally move around. It is ultimately a list of properties: the button's position, its size, its text content, its colour, etc. The renderer is the piece of code that take this list of properties modelling a button and draws an actual button on the screen (or in an offscreen canvas to be composited on screen with the other elementslater). The default renderer would just draw a regular button from your OS's default control library. A custom renderer, however, can do anything you want using that information: It could draw a button with small modifications compared to the regular one, or it could draw what looks like a hyperlink, for example

I don't know if there's a formal definition, but I usually understand it as something that generates the visual output for the user. It's the final step in processing. Whatever it generates is then sent to the output device (although there might still be "post processing" done after this stage).

When we're talking about a GUI, that would be the part of the program that takes all the "windows" and "controls" and "buttons" and "labels" and whatnotelse, and then calls the functions that draw lines and fills areas and letters etc.

Similarly, when you're writing a computer game, the "Renderer" takes your world state data and makes all the calls to the GPU which eventually result in pixels appearing on your screen.

Another slightly different place where I've seen it being used is in ASP.NET WebForms - the rendering phase there takes the control tree and produces the HTML that gets sent to the browser. But the underlying idea is still the same - take your abstract data structures and produce the output that the user will see.

Note that this concept usually isn't used when your program is returning pure data. For example, if you're writing a webservice that returns a JSON formatted object, then the part that converts your objects to the JSON string isn't called a "renderer". Instead you typically call it a "serializer".

It's like Humpty Dumpty in Through the Looking Glass:

"When I use a word," Humpty Dumpty said, in rather a scornful tone, "it means just what I choose it to mean — neither more nor less."

A "renderer" is whatever the person calling it a "renderer" wants it to be. The verb to render is, itself, very broadly defined. It primarily means

to cause to be or become; make

or

to do; perform

You can see how that can be just about anything.

dictionary.com does have a specific relevant meaning listed:

to use the processing power of computer hardware and software to synthesize (the components of an image or animation) in a final graphic output.

And so a renderer would be something that does that. In that definition, I suspect they're mostly talking about the CGI and related meaning of taking the components of a scene and rendering the resulting video, but you can also render a form in HTML for presentation to the user, etc.

But there's also

to translate into another language

and that sense gets used in computing as well.

Primarily, I'd expect a renderer to produce some form of visible output, or something (like a video file) that can readily become visible output. But if I ran across it being used for something else, as long as it was something that took input and produced some form of transformed output, I wouldn't be surprised by it.

It has many meanings. In the context of Xamarin the meaning is "transmit into something or produce". For example, in asp.net you can write C# code with HTML and then it gets rendered (transmitted into) pure html. The renderer takes input and produces output. In Xamarin the Xamarin developers have written code which produces (renders) a form control. If you don't like the default output (appearance) of the form control, you write your own code to produce (render) the form control the way you like it in CustomeRenderer.

You Might Also Like