Merge pull request #1848 from QuantumCoderQC/patch2

Support for displacement in instanced objects
This commit is contained in:
Lubos Lenco 2020-09-08 20:26:10 +02:00 committed by GitHub
commit 00cad1832a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,6 +185,8 @@ def make_base(con_mesh, parse_opacity):
sh = vert
else:
sh = tese
if(con_mesh.is_elem('ipos')):
vert.write('wposition = vec4(W * spos).xyz;')
sh.add_uniform('mat4 VP', '_viewProjectionMatrix')
sh.write('wposition += wnormal * disp;')
sh.write('gl_Position = VP * vec4(wposition, 1.0);')