Texture Mapping in GLSL [Shaders Monthly #5]

  Рет қаралды 3,533

GSN Composer

GSN Composer

Күн бұрын

In Episode #5 of Shaders Monthly, we talk about texture mapping and how it can be implemented in GLSL.
1) Textured Triangle
GSN Composer: www.gsn-lib.org/index.html#pr...
C++: www.mathematik.uni-marburg.de...
Java: www.mathematik.uni-marburg.de...
2) Textured Cube
GSN Composer: www.gsn-lib.org/index.html#pr...
C++: www.mathematik.uni-marburg.de...
Java: www.mathematik.uni-marburg.de...
Documentation for the shader plugin node of the GSN Composer:
gsn-lib.org/docs/nodes/Shader...
Additional lecture slides:
www.uni-marburg.de/en/fb12/re...
00:00 What are Textures?
03:19 Textured Triangle
10:19 Texture Wrapping
12:18 Textured Cube
14:58 Phong Shading with Textures
Stone Demon 3D Model (CC0): sketchfab.com/3d-models/stone...
Music: Left U Into - Otis McDonald (KZbin Audio Library)

Пікірлер: 11
@teamavatar6460
@teamavatar6460 2 жыл бұрын
great stuff!
@mcpegamerz949
@mcpegamerz949 Жыл бұрын
Thanks!
@wewakemartin
@wewakemartin 10 ай бұрын
Thanks for making these tutorials. Very helpful to visualise whats going on in the background of games and 3d animation software. I tried mapping a texture on a plane object and the texture stretches and distorts when I increase the segments number to more than one. Why is this happening?
@gsn-composer
@gsn-composer 10 ай бұрын
Thank you for your comment. In which application? Blender? GSN Composer? In the GSN Composer, I have tried to replace the triangle with a plane (3D.Compute.Generate.Plane) in the provided example ( www.gsn-lib.org/index.html#projectName=ShadersMonthly05&graphName=TexturedTriangle ) and it is possible to increase the number of segments without any problems. In general, you can debug the texture coordinates by assigning them to the output color (see 6:19 min:sec in the video). Or if you do not have access to the shader, you can simply assign a UV color grid as a texture for debugging. In the GSN Composer, a color grid image can be generated with the ImageProcessing.Compute.Generate.ColorGrid node. For Blender, you can follow this tutorial: kzbin.info/www/bejne/m6LdhZSAedWhmc0 Does this answer your question?
@wewakemartin
@wewakemartin 10 ай бұрын
@@gsn-composer hello, thank you for your response. :) I'm using one of the examples on GSN composer. I have increased the segmentX of a Cube to 2, effectively increasing number of faces to 10. Then I used texCoordEdit node to map different areas of labelled colorGrid texture to different faces of the cube using count. However, the texture is distorting on certain areas. What am I doing wrong? Please advise. GSN Composer Graph: #projectName=CubeMappingTest&graphName=CubeMapping
@gsn-composer
@gsn-composer 10 ай бұрын
​@@wewakemartin Okay, now I get it. Yes, in the second example, when you increase the segments of the cube, the texture coordinates are messed up by the 3D.Compute.Mesh.TexCoordEdit node. You can either bypass this node by connecting the mesh from the Cube node directly to the Shader node, or you can "reset" the TexCoordEdit node by selecting its "offset" output and deleting the text. Otherwise, the TexCoordEdit node assigns offsets to the initial texture coordinates and they end up at wrong locations that cause this distortion.
@wewakemartin
@wewakemartin 10 ай бұрын
@@gsn-composer I see, thank you, ill try that out. I was hoping to create some sort of animated mosaic by sampling random parts of a single texture image onto different segments using shaders.. but if they are going to stretch/distort, I will have to figure out another way..
@gsn-composer
@gsn-composer 10 ай бұрын
​@@wewakemartin I created this “mosaic“ example for you: www.gsn-lib.org/index.html#projectName=ForumShadersMonthly05&graphName=RandomTextureLocations Distortion can be avoided by using the same similarity transformation for the texture coordinates for all vertices of a quad (or triangle).
@unveil7762
@unveil7762 7 ай бұрын
This isi so cool!! is there a way to out put the result on an external screen? have a quad mapper as web app can be pritty handy!!
@gsn-composer
@gsn-composer 7 ай бұрын
It is not possible to have two synchronized instances of the GSN Composer in two different browser tabs, one running on an external screen and the other on the primary screen. However, it is possible to view the output in full screen mode. In the GSN Composer interface, you can use the "View Control" panel to set the output of any node as the background. But you will still see some of the interface. Currently there are two ways to get a "clean" full screen mode: 1) If you make the project "public", you will find a "GalleryLink" in the project dialog (next to the graph name). If you append "&fs=1" to this link, you will get a full screen output, see www.gsn-lib.org/docs/gallery.php To switch the browser to full screen mode, press "F11" on Windows. 2) In the project dialog, use the "Export as Website" button. If you are familiar with basic CSS, you will be able to place/scale the output as you like on your website.
What are Mipmaps? Texture Filtering in GLSL [Shaders Monthly #6]
21:29
Why are if statements in shaders heavily discouraged?
11:22
VoxelRifts
Рет қаралды 5 М.
[柴犬ASMR]曼玉Manyu&小白Bai 毛发护理Spa asmr
01:00
是曼玉不是鳗鱼
Рет қаралды 50 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 51 МЛН
He tried to save his parking spot, instant karma
00:28
Zach King
Рет қаралды 16 МЛН
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 2,6 МЛН
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 908 М.
React Three Fiber & Three.js - Textures Explained
10:36
Threeveloper
Рет қаралды 10 М.
7 Examples Proving Shaders are Amazing
8:09
DesignCourse
Рет қаралды 31 М.
Deferred Shading [Shaders Monthly #14]
31:35
GSN Composer
Рет қаралды 901
Perspective Projection in GLSL [Shaders Monthly #2]
19:44
GSN Composer
Рет қаралды 4 М.
Welcome to Shaderland - An introduction to shaders in Godot
1:12:51
Introduction to Phong Lighting
9:44
Suboptimal Engineer
Рет қаралды 12 М.
Textures in OpenGL
31:44
The Cherno
Рет қаралды 166 М.
OpenGL Modelview Matrix and 3D Transformations [Shaders Monthly #3]
29:13
How to Use Quaternions
14:20
Positive Altitude
Рет қаралды 9 М.
[柴犬ASMR]曼玉Manyu&小白Bai 毛发护理Spa asmr
01:00
是曼玉不是鳗鱼
Рет қаралды 50 МЛН