Switch to DuckDuckGo Search
   July 17, 2019
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31

Toggle Join/Part | bottom
[00:09:49] *** LunarJetman <LunarJetman!LunarJetma@94.14.216.120> has quit IRC (Quit: LunarJetman)
[00:13:49] *** goiko <goiko!~goiko@unaffiliated/goiko> has joined ##vulkan
[01:04:18] *** ColaEuphoria <ColaEuphoria!~ColaEupho@unaffiliated/colaeuphoria> has joined ##vulkan
[01:08:39] *** ratchetfreak <ratchetfreak!~ratchetfr@ptr-82s3g7nyo2zjr8pdfah.18120a2.ip6.access.telenet.be> has quit IRC (Ping timeout: 252 seconds)
[01:12:09] <ColaEuphoria> Are geometry shaders an efficient way to do flat shading? I heart geometry shaders are slow
[01:18:30] <mirv_> do you mean something like cel shading, or vertex output attributes?
[01:23:23] <ColaEuphoria> mirv_, just simple flat shading. smooth shading is easy because you can store a single normal per vertex, but with flat shading you would either need to split every single face or generate a normal using the cross product in a geometry shader
[01:24:57] <mirv_> you could store a single normal per triangle
[01:25:26] <mirv_> or use the flat qualifier when passing normal values to the fragment stage
[01:25:43] <ColaEuphoria> mirv_, but everything is done per-vertex
[01:25:49] <ColaEuphoria> in the vertex shader
[01:26:13] <mirv_> yes
[01:26:47] <mirv_> I mean, you could generate normals on the fly I suppose
[01:27:51] <mirv_> geometry shader could do that
[01:28:11] <mirv_> but honestly, just precalc it from the vertex data and supply in a buffer
[01:28:36] <mirv_> modify with whatever modelview transform, and done
[01:29:02] <ColaEuphoria> mirv_, you mean like I could send a per-vertex index into a uniform buffer to get the normal?
[01:30:12] <mirv_> whatever mesh you have, the vertices will form a triangle - so on the cpu side, just calculate it all there
[01:30:22] <mirv_> and make it part of the mesh format
[01:30:56] <mirv_> if it's per-vertex, you can either make all the normals the same for a particlar face, or use the flat qualifier
[01:31:35] <mirv_> no need to index anything in the vertex shader, it's just per-vertex data
[01:31:54] <mirv_> or per-vertex attribute data I should say
[01:34:15] <mirv_> but by specifying "flat" in the output variable, the rasteriser should generate the same normal for every fragment of a triangle
[01:34:31] <mirv_> giving you flat shading
[01:39:11] <ColaEuphoria> mirv_, oh, so the 'flat' qualifier causes the rasterizer to average the variable for the face?
[01:42:37] <mirv_> well, takes it from the provoking vertex I believe
[01:43:11] <mirv_> if you had, say a cube, you would need to duplicate a few vertices to change their normals
[01:43:27] <mirv_> but a sphere, it'd look about the same without doing that
[01:45:50] <mirv_> and with apologies, but I gotta get some sleep now
[01:46:11] <mirv_> google around for "vulkan flat shading", or look it up in the vulkan spec, it has more info there about it
[01:50:19] *** mpersano <mpersano!~mauro@177.32.193.126> has quit IRC (Quit: leaving)
[01:51:20] *** derhass <derhass!~derhass@dslb-188-102-016-172.188.102.pools.vodafone-ip.de> has quit IRC (Ping timeout: 272 seconds)
[04:45:01] *** pa <pa!~pa@unaffiliated/pa> has quit IRC (Ping timeout: 258 seconds)
[04:46:42] *** wildlander <wildlander!~wildlande@unaffiliated/wildlander> has quit IRC (Ping timeout: 245 seconds)
[04:58:34] *** pa <pa!~pa@unaffiliated/pa> has joined ##vulkan
[05:05:05] *** slime <slime!~slime73@blk-215-81-93.eastlink.ca> has quit IRC (Quit: This computer has gone to sleep)
top

   July 17, 2019
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31