Announcement

Collapse
No announcement yet.

Parallax Occlusion Mapping use Shared Sampler

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by vinz243 View Post
    Hey everyone,

    I'm trying the new POM node in my game and since I need POM on landscape I need it not to take any texture sampler. So I tried to replace this:

    Code:
    while (i<MaxSteps+2)
    {
    texatray=dot(HeightMapChannel, Tex.SampleGrad(TexSampler,UV+offset,InDDX,InDDY));
    
    if (rayheight < texatray)
    {
    float xintersect = (oldray-oldtex)+(texatray-rayheight);
    xintersect=(texatray-rayheight)/xintersect;
    yintersect=(oldray*(xintersect))+(rayheight*(1-xintersect));
    offset-=(xintersect*UVDist);
    break;
    }
    with this

    Code:
    while (i<MaxSteps+2)
    {
    texatray=dot(HeightMapChannel, Tex.SampleGrad(GetMaterialSharedSampler(TexSampler,Material.Wrap_WorldGroupSettings),UV+offset,InDDX,InDDY));
    
    if (rayheight < texatray)
    {
    float xintersect = (oldray-oldtex)+(texatray-rayheight);
    xintersect=(texatray-rayheight)/xintersect;
    yintersect=(oldray*(xintersect))+(rayheight*(1-xintersect));
    offset-=(xintersect*UVDist);
    break;
    }
    However it does not work since it still consumes a sampler slot. So I can't put too much layers with POM since it won't compile.


    Thanks in advance
    You can pick shared sampler from view struct. eg. View.MaterialTextureBilinearWrapedSampler

    Leave a comment:


  • replied
    It's still using a sampler even if it's shared. Why not try describing what you're trying to do a bit more?

    Leave a comment:


  • replied
    Did someone found a way to set the sampler source of the ParallaxOcclusionMapping node to "shared" ?

    Leave a comment:


  • replied
    uppppp pls

    Leave a comment:


  • started a topic Parallax Occlusion Mapping use Shared Sampler

    Parallax Occlusion Mapping use Shared Sampler

    Hey everyone,

    I'm trying the new POM node in my game and since I need POM on landscape I need it not to take any texture sampler. So I tried to replace this:

    Code:
    while (i<MaxSteps+2)
    {
    texatray=dot(HeightMapChannel, Tex.SampleGrad(TexSampler,UV+offset,InDDX,InDDY));
    
    if (rayheight < texatray)
    {
    float xintersect = (oldray-oldtex)+(texatray-rayheight);
    xintersect=(texatray-rayheight)/xintersect;
    yintersect=(oldray*(xintersect))+(rayheight*(1-xintersect));
    offset-=(xintersect*UVDist);
    break;
    }
    with this

    Code:
    while (i<MaxSteps+2)
    {
    texatray=dot(HeightMapChannel, Tex.SampleGrad(GetMaterialSharedSampler(TexSampler,Material.Wrap_WorldGroupSettings),UV+offset,InDDX,InDDY));
    
    if (rayheight < texatray)
    {
    float xintersect = (oldray-oldtex)+(texatray-rayheight);
    xintersect=(texatray-rayheight)/xintersect;
    yintersect=(oldray*(xintersect))+(rayheight*(1-xintersect));
    offset-=(xintersect*UVDist);
    break;
    }
    However it does not work since it still consumes a sampler slot. So I can't put too much layers with POM since it won't compile.


    Thanks in advance
Working...
X