[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/3/ - 3DCG


View post   

File: 256 KB, 800x600, 586476584.jpg [View same] [iqdb] [saucenao] [google]
678387 No.678387 [Reply] [Original]

What is a shader and is there a precise definition?
I see some people use it interchangably with materials and even sometimes textures while others don't.
This happens across the industry in all fields of 3d.
What the fuck is going on?

>> No.678390

>>678387
normal people
>a programmed function for shading(calculating light) things in a certain way
retards
>a shiny ball wtih texture XDD

>> No.678391
File: 27 KB, 477x387, 1484507221501.png [View same] [iqdb] [saucenao] [google]
678391

>>678387
A shader is the thing that you plug your texture maps into and possesses the properties (often physically correct) of the material you want to represent in your 3D scene.

For instance: metal, dielectric (plastic, wood, etc.), glass, skin, etc.

It's the thing that defines the surface of a mesh once the renderer calculates how the lights hit it and whatnot.

One thing is for sure, shader =/= textures

AMA if it's still not clear

>> No.678395
File: 212 KB, 800x600, 5454.jpg [View same] [iqdb] [saucenao] [google]
678395

>>678390
Thank you for clearing this up.
>>678391
Wait, what you just described is a material.

>> No.678399

>>678395
shader (properties) + textures (visual info) = material

>> No.678402
File: 256 KB, 640x480, xyfkfxyk.png [View same] [iqdb] [saucenao] [google]
678402

>>678399
Much appreciated.

>> No.678403

>>678402
anytime m8

>> No.678968

>>678390
Well it's not always light. Even VLC filters are shaders. A shader is a program composed of a vertex program and/or a fragment program and/or a geometry program and/or a tessellation program. You basically control what happens between things using the GPU. It's could be moving vertices, could be how light is calculated, could be a implementation height maps, could be a screen filter, etc. You're essentially controlling how things are rendered on a screen. Vertex programs, for example, control how things work between vertices. The space between verts is interpolated. Easiest(but not the only, obviously) example is Gouraud shading(https://en.wikipedia.org/wiki/Gouraud_shading).). Look at the specular. While fragment programs run a program for each fragment on the screen, which gives you phong or blinn-phong for example. Geometry program controls/creates geometry, Same for the Tessellation program. Again, you could make wind, weird moving blobs, or nightvision with shaders- they're not just for materials.
For example, this- https://www.youtube.com/watch?v=qKN1_dxtxUE is all shader. Doesn't have any animations or whatever, everything's basically procedural.

>> No.678970

>>678968
shit link* https://en.wikipedia.org/wiki/Gouraud_shading