Author Topic: Parallax Mapping example  (Read 989 times)

Offline primosz67

  • byte
  • *
  • Posts: 17
    • View Profile
Parallax Mapping example
« on: April 03, 2013, 12:20:52 am »
 It's working fine , but...

Is it possible to add mapping after the object is rendered in the word.

more clearly:
1. I have the scene
2. I'm adding the primitive "plane" object.
3. I click on the button to add parallax mapping.

thx in advance.


 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Parallax Mapping example
« Reply #1 on: April 03, 2013, 07:26:10 am »
Yes, it's possible but complicated. In this case, i think the simplest solution would be to swap the object itself, i.e. create one with parallax and one without and switch between them.

Offline primosz67

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Parallax Mapping example
« Reply #2 on: April 03, 2013, 08:55:15 am »
what do you think about  clone object and dispose original object from world, reload settings from my wrapper for cloned object  and then put object with parallax mapping to world?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Parallax Mapping example
« Reply #3 on: April 03, 2013, 09:37:23 am »
Yes, something like that.

Offline primosz67

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Parallax Mapping example
« Reply #4 on: April 03, 2013, 09:56:39 pm »
I  was about to ask how to make texture repeatable but i find the solution:

this
   vec2 newTexCoord = (texCoord + offset)  ;

change to this:

        vec2 newTexCoord = (texCoord * scaleValue + offset)  ;

putting here if i forget and i couldn't find this on forum.
question: How to make the bump also be repeatable
« Last Edit: April 04, 2013, 06:43:02 am by primosz67 »