Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Parallax Mapping #9

Closed
Akira1San opened this issue Jan 7, 2016 · 18 comments
Closed

Request: Parallax Mapping #9

Akira1San opened this issue Jan 7, 2016 · 18 comments
Milestone

Comments

@Akira1San
Copy link

Add build-in Parallax Mapping. This technique will add more depth or realism to the 3d models of the game developer project. The user will go to the material panel and check the box and adjust the slider value.
Example: Parallax Occlusion Mapping in GLSL -> http://sunandblackcat.com/tipFullView.php?topicid=28

@DCubix
Copy link
Collaborator

DCubix commented Jan 7, 2016

Also here and here

I think I can try to implement this. It's not that difficult 👍

@carlo697
Copy link

carlo697 commented Jan 7, 2016

1+ For this to be added, mainly the firsts techniques added can be: parallax mapping and steep parallax mapping, and maybe later can be added: parallax occlusion mapping and/or relief rarallax mapping.

It would be good that KX_BlenderMaterial have an attribute to enable/disable the parallax (material.parallaxMapping=bool) and other one for the number of steps (material.parallaxSteps=int), but this can be added later.

@lordloki
Copy link
Member

lordloki commented Jan 7, 2016

@Akira1San
Copy link
Author

Thats awesome.

@youle31
Copy link
Collaborator

youle31 commented Jan 8, 2016

Thanks Lordloki for the link :)

@Akira1San
Copy link
Author

Parallax Mapping with Offset Limiting: A Per-Pixel Approximation of Uneven Surfaces -> https://github.com/marcusstenbeck/tncg14-parallax-mapping
Looks useful with example files and a pdf doc.

@youle31
Copy link
Collaborator

youle31 commented Jan 11, 2016

I updated the patch from angelo. Thanks very much Lordloki. http://www.pasteall.org/pic/97582
I'll try to contact him to ask his permission to commit that in upbge.

@lordloki
Copy link
Member

Hi youle,

I think it is not necessary to ask for his permission. It was a public patch over a GPL code -> automatically the patch is GPL. I think it would be enough giving him credit in the commit and/or the code.

@Akira1San
Copy link
Author

Cool image. I have a question. Does the Parallax have any kind of lod?

@youle31
Copy link
Collaborator

youle31 commented Jan 13, 2016

@lordloki: Hi, actually, I think we'll try to contact angelo, because his patch works great with his example file, but I don't know how to reproduce nice normal maps with alpha (in his patch, height for parallax is stored in normal texture alpha channel). TwisterGE is working on this :)

@Akira1San: No for the moment, there is no such feature... I don't know if we can do this (decrease parallax steps according to distance camera>object? I don't know if the render would be nice...)

@Akira1San
Copy link
Author

In this pdf -> http://developer.amd.com/wordpress/media/2012/10/Tatarchuk-ParallaxOcclusionMapping-Sketch-print.pdf
"We determine the current mip map level directly in the pixel shader and use this information to transition between different levels of detail from the full effect to simple normal mapping. We render the lowest level of details using regular normal mapping shading. As the surface approaches the viewer, we increase the sampling rate for the full parallax occlusion mapping computation as a function of the current mip level. We specify an artist-directable threshold level where the transition between the parallax occlusion mapping and the normal mapping computations will occur."
I guess this lod system is for fps/tps games.

@youle31
Copy link
Collaborator

youle31 commented Jan 14, 2016

@Akira1San: Sounds complex :)

http://www.pasteall.org/pic/97711 (once we get the technique to create appropriate normal maps with gimp, we can get some good results. Not perfect for the moment hehe)

@panzergame
Copy link
Contributor

If you want to test the parallax feature, compile UPBGE on ge_parallax branch.

@Akira1San
Copy link
Author

Why does the texture have to be with alpha channel?

@youle31
Copy link
Collaborator

youle31 commented Jan 24, 2016

The height/depth is encoded in normal map alpha channel. The shader reads alpha value to set texture height.

@panzergame
Copy link
Contributor

Done : 3c673aa and 248743c. Some tutorials are coming soon.

@DCubix DCubix modified the milestone: 0.1 Jun 28, 2016
@angjminer
Copy link

sorry for being a year late, but nice. glad to see someone getting use/inspiration out of something i did...

@youle31
Copy link
Collaborator

youle31 commented Oct 19, 2017

@angjminer : Thanks very much for your work! It's @lordloki who showed to us your work. I remember the first time we had it working (it was in our 2.76 branch), that was great :)

RafaelTavars added a commit that referenced this issue Sep 28, 2021
UPBGE: Try to fix another issue coming from previous commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants