Jump to content

displacement mapping


dreamhead
 Share

Recommended Posts

is there a shader for leadwerks that does displacement mapping,so yes how do i add in the mat file?

 

thx in advance :)

the real world is in my head

CPU-Intel® Core2 Quad CPU Q6600 @ 2.40GHz

CPU Speed 2.40 GHz

RAM 3.5 GB

OS Microsoft Windows XP Professional (Build Service Pack 32600)

Video Card GeForce 8800 GT

Video Card Features-

*Video RAM 512.0 MB

Video RAM 256 MB 512.0 MB

Hardware T&L Yes

Pixel Shader version 3.0

Vertex Shader version 3.0

using:leadwerks2.3,2

[ dreamhead.png

Link to comment
Share on other sites

I've seen PoM and Parallax shaders in LE, not sure how to use them or how to make textures for them. I believe both are special versions of a displacement shader.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

i have used the Parallax shaders,but get a real wierd result

it was like the shadow was moving with my camera of my objecht :)

 

Mat file

 

texture0="abstract::BrickRound_D.dds"
texture1="abstract::BrickRound_Disp.dds"

shader="abstract::mesh_diffuse_bumpmap_parallax.vert","abstract::mesh_diffuse_bumpmap_parallax.frag"
shadowshader="abstract::mesh_shadow.vert"

the real world is in my head

CPU-Intel® Core2 Quad CPU Q6600 @ 2.40GHz

CPU Speed 2.40 GHz

RAM 3.5 GB

OS Microsoft Windows XP Professional (Build Service Pack 32600)

Video Card GeForce 8800 GT

Video Card Features-

*Video RAM 512.0 MB

Video RAM 256 MB 512.0 MB

Hardware T&L Yes

Pixel Shader version 3.0

Vertex Shader version 3.0

using:leadwerks2.3,2

[ dreamhead.png

Link to comment
Share on other sites

try using this and see if you get better results:

 

texture0="abstract::BrickRound_D.dds"
clamp0=0,0,0
texture1="abstract::BrickRound_Disp.dds"
clamp1=0,0,0
blend=0
depthmask=1
depthtest=1
overlay=0
zsort=0
cullface=1
castshadows=1
specular=0.100000001
bumpscale=1.00000000
gloss=0.100000001
shader="abstract::mesh_diffuse_bumpmap_parallax.vert","abstract::mesh_diffuse_bumpmap_specular_pom.frag"
shadowshader="abstract::mesh_shadow.vert",""

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

I think you have to save the parallax map into the alpha of the diffuse texture if you are using the "mesh_diffuse_bumpmap_specular_pom.frag" shader that Macklebee posted.

 

If you are using the "mesh_diffuse_bumpmap_parallax.frag" shader you originally had you need a normal map assigned to texture1, and your displacement map would need to be assigned to texture2 in your mat file, like this:

 

texture0="abstract::BrickRound_D.dds"
texture1="abstract::BrickRound_Dot3.dds"
texture2="abstract::BrickRound_Disp.dds"

shader="abstract::mesh_diffuse_bumpmap_parallax.vert","abstract::mesh_diffuse_bumpmap_parallax.frag"
shadowshader="abstract::mesh_shadow.vert"

 

I think the code you had posted was trying to use BrickRound_Disp.dds for normal information, and then didn't have a height map to use for the parallax effect.

Vista | AMD Dual Core 2.49 GHz | 4GB RAM | nVidia GeForce 8800GTX 768MB

Online Portfolio | www.brianmcnett.com

Link to comment
Share on other sites

Along the same lines of this topic, does anyone know if there is a way to add parallax maps to terrain textures, or how to modify the terrain shaders to allow for them? This would be nice since many terrain materials are typically the kind that benefit the most from parallax occlusion. You can also store displacement maps in the alpha channel of the diffuse map of terrain textures since they don't need transparency.

Vista | AMD Dual Core 2.49 GHz | 4GB RAM | nVidia GeForce 8800GTX 768MB

Online Portfolio | www.brianmcnett.com

Link to comment
Share on other sites

Omid had a test of Parallax/POM here.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

I only ever tried it using Omids test example .. not really found a need for it .. yet.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

i wil try that guys thanke you very much for your help guys,i wil let you now if it works or not

the real world is in my head

CPU-Intel® Core2 Quad CPU Q6600 @ 2.40GHz

CPU Speed 2.40 GHz

RAM 3.5 GB

OS Microsoft Windows XP Professional (Build Service Pack 32600)

Video Card GeForce 8800 GT

Video Card Features-

*Video RAM 512.0 MB

Video RAM 256 MB 512.0 MB

Hardware T&L Yes

Pixel Shader version 3.0

Vertex Shader version 3.0

using:leadwerks2.3,2

[ dreamhead.png

Link to comment
Share on other sites

oke i got something,it was not quite what i was hoping for but it is a start :)

post-56-12694632713758_thumb.jpg

the real world is in my head

CPU-Intel® Core2 Quad CPU Q6600 @ 2.40GHz

CPU Speed 2.40 GHz

RAM 3.5 GB

OS Microsoft Windows XP Professional (Build Service Pack 32600)

Video Card GeForce 8800 GT

Video Card Features-

*Video RAM 512.0 MB

Video RAM 256 MB 512.0 MB

Hardware T&L Yes

Pixel Shader version 3.0

Vertex Shader version 3.0

using:leadwerks2.3,2

[ dreamhead.png

Link to comment
Share on other sites

  • 2 months later...

I recommend you to make a gaussian blur with an amount of 2-3 to your diffuse map. It helps smoothing the displacement very much. Otherwise you get too rough surfaces. Crysis has a clever displacement mapping on the terrain, all small rocks and stuff (the ones on the terrain only, not the big rocks which are modeled and placed separately) are displacement maps on the terrain but when you go away, they get thinner and at the end, they become ordinary textures when you are on enough distance. They can make samples of a small region with that technique, otherwise they had to fragment the whole terrain into small pieces, which is not possible in practical case.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...