In recent years, the demanded quality of 3D visual applications by the public has been growing at a steady rate. While the new tools at the disposal of artists and designers allow them to produce high quality visual experiences, there are still some tasks which are both critical and time consuming when producing an high quality render. One of these tasks is often programming a dedicated shader which can render the produced asset in the best way possible. Currently, programming a new shader requires technical knowledge of shader languages such as HLSL and GLSL, which leads development teams to either look for artists with technical knowledge for shader programming or to hire dedicated individuals under the role of technical artists. The task of shader programming, therefore, is costly and its price often cannot be payed by smaller development teams. Iterating on the shader program can also be a time consuming task given by the fact that, apart from some input values which can be changed, shader programs favour performance over versatility. In the latest years, some companies tried to bridge the gap between the artists and the technical knowledge needed through the use of visual programming tools that represent shader programs through a graph model. While these tools are certainly a step in the right direction, they still require artists to acquire expertise over the rendering pipeline as well as technical knowledge which would not be required outside of programming shaders. The work presented in this document thus tackles the issue of requiring technical knowledge from artists and designer, by designing a tool in the Unity3D rendering engine. The tool, called Shader Graph Autogen (SGA), leverages the graph model implemented by Shader Graph, a visual programming tool for shaders implemented into Unity. The graph model is reused as part of the chromosome representation of a Genetic Algorithm implemented into the developed tool and tailored towards producing working shaders which can have real practical use during production. Previous work done on implementing Genetic Algorithms for producing shader programs has been limited to producing code for just sections of the rendering pipeline or to produce shaders specialized for a single 3D application. This project aims at producing shaders which fully leverage the entire rendere pipeline and can be used more generally. A system for interfacing with Shader Graph's model is thus implemented together with a set of heuristics that guide the Genetic Algorithm when generating new shading programs. Ultimately, a User Interface (UI) has also been implemented in order to let users with little technical knowledge interact with such tool, by setting values that dictate the Genetic Algorithm's behaviour such as the kind of mutations allowed and the number of specimens generated per each generation. The document is structured like the following: - Chapter 1 introduces the problem and the reasons why such work may be useful to the industry of Video Games as well as 3D application development. - Chapter 2 goes over the technical and theoretical preliminary knowledge for the project as well as describe the Shader Graph tool and its graph representation of shaders. - Chapter 3 describes the current state of the art, looks at what work has been done thus far in order to make shader programming a more visual task and ultimately analyzes the previous work done on implementing Genetic Algorithms for procedural generation of shader programs. - Chapter 4 shows how the tool has been implemented, the challenges that have been faced and what choices have been made in order to tackle such challenges. - Chapter 5, finally, describes the tool that has been produced and how the user can generate shaders with it. - Chapter 6 sums up the presentation of the work done and introduces future work that can expand on what has been done thus far.

Negli ultimi anni, la qualità grafica richiesta dal pubblico per le applicazioni grafiche 3D è andata aumentando constantemente. Nonostante ci siano strumenti a disposizione di artisti e designers che permettono di produrre esperienze visive di alta qualità, ci sono ancora parti della produzione di queste esperienze che, oltre ad essere critiche per la qualità finale, richiedono una grande mole di tempo. Una di queste attività è spesso quella di programmare uno shader che possa produrre un render nella maniera migliore possibile. Al momento, creare un nuovo programma di shading richiede conoscenze techniche di linguaggi di shading quali HLSL e GLSL. Questa richiesta porta spesso i team di sviluppo a cercare artisti che abbiano anche competenze tecniche oppure ad assumere figure dedicate a questa attività, chiamati technical artists. Programmare shaders, quindi, è un processo costoso il cui prezzo spesso non può essere pagato da team di sviluppo più piccoli. Questo è anche esacerbato dal fatto che iterare su un programma di shading è spesso un processo altrettanto lungo in quanto il codice di shading è specifico per essere più performante che versatile. Negli ultimi anni, alcune compagnie hanno provato a ridurre il divario che c'è tra gli artisti e le conoscenze tecniche richieste, implementando strumenti di programmazione visuale che rappresentano i programmi di shading tramite un modello a grafo. Questi strumenti sono certamente un passo nella giusta direzione ma richiedono comunque che gli artisti acquisiscano competenza su come funziona la rendering pipeline di un motore grafico e conoscenze sul funzionamento interno di uno shader, che non verrebbero richieste al di fuori di questa attività. Di seguito, dunque, viene presentato del lavoro che è stato fatto per affrontare il problema del requisito di conoscenza tecnica da parte di designers e artisti. E' stato dunque creato uno strumento in Unity3D che possa aiutare a tal proposito. Questo tool, chiamato Shader Graph Autogen (SGA), sfrutta il modello a grafo implementato da Shader Graph, uno strumento di programmazione visuale per shaders implementato per Unity. Il modello a grafo viene dunque riutilizzato per la rappresentazione dello shader all'interno di un algoritmo genetico, implementato all'interno dello strumento prodotto e specifico per produrre shader funzionanti con una applicazione pratica. Lavori precedenti sull'applicazione di algoritmi genetici alla creazione di shader si sono limitati a parti dell'intera render pipeline e non hanno reso possibile la modifica dei programmi prodotti se non tramite linguaggio di programmazione. Questo progetto si pone come obiettivo di produrre shader che sfruttino la render pipeline per intero e che siano rappresentabili tramite lo Shader Graph di Unity per migliorare l'accessibilità. Al fine di produrre questo strumento in Unity, quindi, un sistema per interfacciarsi tramite C# con il modello a grafo in Shader Graph è stato implementato con un insieme di euristiche che guidano l'algoritmo genetico nella generazione di nuovi programmi di shading. Infine, un'interfaccia grafica è stata implementata al fine di permettere agli utenti con limitata conoscenza tecnica di interagire con questo tool, impostando dei valori che dettano alcune delle impostazioni dell'algoritmo genetico tra cui il tipo di mutazioni permesse ed il numero di esemplari generati ad ogni nuova generazione. Il documento è strutturato come segue: - Il Capitolo 1 introduce il problema e le ragioni per cui il lavoro presentato può essere utile all'industria dei videogiochi e della produzione di applicazioni 3D. - Nel Capitolo 2 vengono spiegate le conoscenze tecniche e teoriche preliminari al lavoro che è stato prodotto, viene inoltre descritto il funzionamento di Shader Graph ed il modello a grafo. - Il Capitolo 3 descrive lo stato dell'arte corrente ed osserva il lavoro che è stato fatto finora per rendere il processo di programmazione di shader un'attività più incentrata sul visivo in modo tale da essere preferibile ad artisti e designers. Viene inoltre analizzato il lavoro già fatto sulla generazione procedurale di shader tramite utilizzo di algoritmi genetici. - Il Capitolo 4 mostra come lo strumento è stato implementato, le sfide affrontate e le scelte operate in termini di design al quale queste sfide hanno portato. - Il Capitolo 5, invece, descrive lo strumento in sè e la sua interfaccia grafica, spiegando come un utente possa generarci shaders. - Il Capitolo 6, infine, riassume la presentazione del lavoro fatto ed illustra ciò che può essere fatto per estenderlo.

Procedural shader generation in Unity3D

SASSO, ELIO
2020/2021

Abstract

In recent years, the demanded quality of 3D visual applications by the public has been growing at a steady rate. While the new tools at the disposal of artists and designers allow them to produce high quality visual experiences, there are still some tasks which are both critical and time consuming when producing an high quality render. One of these tasks is often programming a dedicated shader which can render the produced asset in the best way possible. Currently, programming a new shader requires technical knowledge of shader languages such as HLSL and GLSL, which leads development teams to either look for artists with technical knowledge for shader programming or to hire dedicated individuals under the role of technical artists. The task of shader programming, therefore, is costly and its price often cannot be payed by smaller development teams. Iterating on the shader program can also be a time consuming task given by the fact that, apart from some input values which can be changed, shader programs favour performance over versatility. In the latest years, some companies tried to bridge the gap between the artists and the technical knowledge needed through the use of visual programming tools that represent shader programs through a graph model. While these tools are certainly a step in the right direction, they still require artists to acquire expertise over the rendering pipeline as well as technical knowledge which would not be required outside of programming shaders. The work presented in this document thus tackles the issue of requiring technical knowledge from artists and designer, by designing a tool in the Unity3D rendering engine. The tool, called Shader Graph Autogen (SGA), leverages the graph model implemented by Shader Graph, a visual programming tool for shaders implemented into Unity. The graph model is reused as part of the chromosome representation of a Genetic Algorithm implemented into the developed tool and tailored towards producing working shaders which can have real practical use during production. Previous work done on implementing Genetic Algorithms for producing shader programs has been limited to producing code for just sections of the rendering pipeline or to produce shaders specialized for a single 3D application. This project aims at producing shaders which fully leverage the entire rendere pipeline and can be used more generally. A system for interfacing with Shader Graph's model is thus implemented together with a set of heuristics that guide the Genetic Algorithm when generating new shading programs. Ultimately, a User Interface (UI) has also been implemented in order to let users with little technical knowledge interact with such tool, by setting values that dictate the Genetic Algorithm's behaviour such as the kind of mutations allowed and the number of specimens generated per each generation. The document is structured like the following: - Chapter 1 introduces the problem and the reasons why such work may be useful to the industry of Video Games as well as 3D application development. - Chapter 2 goes over the technical and theoretical preliminary knowledge for the project as well as describe the Shader Graph tool and its graph representation of shaders. - Chapter 3 describes the current state of the art, looks at what work has been done thus far in order to make shader programming a more visual task and ultimately analyzes the previous work done on implementing Genetic Algorithms for procedural generation of shader programs. - Chapter 4 shows how the tool has been implemented, the challenges that have been faced and what choices have been made in order to tackle such challenges. - Chapter 5, finally, describes the tool that has been produced and how the user can generate shaders with it. - Chapter 6 sums up the presentation of the work done and introduces future work that can expand on what has been done thus far.
LOIACONO, DANIELE
ING - Scuola di Ingegneria Industriale e dell'Informazione
21-dic-2021
2020/2021
Negli ultimi anni, la qualità grafica richiesta dal pubblico per le applicazioni grafiche 3D è andata aumentando constantemente. Nonostante ci siano strumenti a disposizione di artisti e designers che permettono di produrre esperienze visive di alta qualità, ci sono ancora parti della produzione di queste esperienze che, oltre ad essere critiche per la qualità finale, richiedono una grande mole di tempo. Una di queste attività è spesso quella di programmare uno shader che possa produrre un render nella maniera migliore possibile. Al momento, creare un nuovo programma di shading richiede conoscenze techniche di linguaggi di shading quali HLSL e GLSL. Questa richiesta porta spesso i team di sviluppo a cercare artisti che abbiano anche competenze tecniche oppure ad assumere figure dedicate a questa attività, chiamati technical artists. Programmare shaders, quindi, è un processo costoso il cui prezzo spesso non può essere pagato da team di sviluppo più piccoli. Questo è anche esacerbato dal fatto che iterare su un programma di shading è spesso un processo altrettanto lungo in quanto il codice di shading è specifico per essere più performante che versatile. Negli ultimi anni, alcune compagnie hanno provato a ridurre il divario che c'è tra gli artisti e le conoscenze tecniche richieste, implementando strumenti di programmazione visuale che rappresentano i programmi di shading tramite un modello a grafo. Questi strumenti sono certamente un passo nella giusta direzione ma richiedono comunque che gli artisti acquisiscano competenza su come funziona la rendering pipeline di un motore grafico e conoscenze sul funzionamento interno di uno shader, che non verrebbero richieste al di fuori di questa attività. Di seguito, dunque, viene presentato del lavoro che è stato fatto per affrontare il problema del requisito di conoscenza tecnica da parte di designers e artisti. E' stato dunque creato uno strumento in Unity3D che possa aiutare a tal proposito. Questo tool, chiamato Shader Graph Autogen (SGA), sfrutta il modello a grafo implementato da Shader Graph, uno strumento di programmazione visuale per shaders implementato per Unity. Il modello a grafo viene dunque riutilizzato per la rappresentazione dello shader all'interno di un algoritmo genetico, implementato all'interno dello strumento prodotto e specifico per produrre shader funzionanti con una applicazione pratica. Lavori precedenti sull'applicazione di algoritmi genetici alla creazione di shader si sono limitati a parti dell'intera render pipeline e non hanno reso possibile la modifica dei programmi prodotti se non tramite linguaggio di programmazione. Questo progetto si pone come obiettivo di produrre shader che sfruttino la render pipeline per intero e che siano rappresentabili tramite lo Shader Graph di Unity per migliorare l'accessibilità. Al fine di produrre questo strumento in Unity, quindi, un sistema per interfacciarsi tramite C# con il modello a grafo in Shader Graph è stato implementato con un insieme di euristiche che guidano l'algoritmo genetico nella generazione di nuovi programmi di shading. Infine, un'interfaccia grafica è stata implementata al fine di permettere agli utenti con limitata conoscenza tecnica di interagire con questo tool, impostando dei valori che dettano alcune delle impostazioni dell'algoritmo genetico tra cui il tipo di mutazioni permesse ed il numero di esemplari generati ad ogni nuova generazione. Il documento è strutturato come segue: - Il Capitolo 1 introduce il problema e le ragioni per cui il lavoro presentato può essere utile all'industria dei videogiochi e della produzione di applicazioni 3D. - Nel Capitolo 2 vengono spiegate le conoscenze tecniche e teoriche preliminari al lavoro che è stato prodotto, viene inoltre descritto il funzionamento di Shader Graph ed il modello a grafo. - Il Capitolo 3 descrive lo stato dell'arte corrente ed osserva il lavoro che è stato fatto finora per rendere il processo di programmazione di shader un'attività più incentrata sul visivo in modo tale da essere preferibile ad artisti e designers. Viene inoltre analizzato il lavoro già fatto sulla generazione procedurale di shader tramite utilizzo di algoritmi genetici. - Il Capitolo 4 mostra come lo strumento è stato implementato, le sfide affrontate e le scelte operate in termini di design al quale queste sfide hanno portato. - Il Capitolo 5, invece, descrive lo strumento in sè e la sua interfaccia grafica, spiegando come un utente possa generarci shaders. - Il Capitolo 6, infine, riassume la presentazione del lavoro fatto ed illustra ciò che può essere fatto per estenderlo.
File allegati
File Dimensione Formato  
Procedural Shader Generation in Unity3D.pdf

embargo fino al 29/11/2024

Descrizione: Documento di tesi principale
Dimensione 8.38 MB
Formato Adobe PDF
8.38 MB Adobe PDF   Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/183740