Login | Register 

PBR Displacement example

Helpful techniques for working with TouchDesigner. Answers only, no questions.

Re: PBR Displacement example

Postby flowb » Fri Apr 14, 2017 10:12 am

When I start with the example and use the env mapping setup i've been using it seems to work fine. Sorry for the mixup.

Thank you so much for making this reference setup! It's priceless. Now if we could get dynamic mesh tessellation... :)
User avatar
Posts: 90
Joined: Fri Dec 05, 2014 2:00 pm
Location: Los Angeles

Re: PBR Displacement example

Postby vertexshining » Tue Aug 29, 2017 5:53 pm

amazing example!

Just trying to figure out why the vertices are displaced in one direction instead of being parallel to the surface of the sphere.
In fact if you put a grid in place of the sphere the displacement goes "diagonal" inseat of straight up to the y-axe like a regular vertex displacement.

I've tried to tweak a bit the vertex shader, in partcular the following line (37)

vec3 newP = P + (N+noSample.rgb) * dsSample.rgb * uDisplace.x;

but with no luck
Posts: 36
Joined: Fri Mar 24, 2017 7:17 am

Re: PBR Displacement example

Postby raganmd » Tue Aug 29, 2017 6:49 pm

You really want a scaling operation here:
Code: Select all
vec3 newP = P + (N*noSample.rgb) * dsSample.rgb * uDisplace.x;

Rather than a translation operation:
Code: Select all
vec3 newP = P + (N+noSample.rgb) * dsSample.rgb * uDisplace.x;

That still ends up a little egg shaped when pushed all the way to the displace max, you might also try looking at what happens if you just use the height map:

Code: Select all
vec3 newP = P + (N*dsSample.rgb)* uDisplace.x;

You'll also end up with different results if you add a texture SOP inline inside of the geo - this lets you change how uvs are assigned on the object - which will in turn change how you're sampling from the displacement textures.
Posts: 1297
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA


Return to Techniques

Who is online

Users browsing this forum: No registered users and 2 guests