Bump/Parallax Mapping -anyone have a working GLSL example?
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Bump/Parallax Mapping -anyone have a working GLSL example?
I have been hacking around all morning with a bunch of net tutorials and sample code,. however no Bump/Parallax working correctly yet,. does anyone have a .zgeproj file to show?
Here is some stuff I have found;
http://www.ozone3d.net/tutorials/bump_mapping_p4.php
http://www.dhpoware.com/demos/glslParal ... pping.html
this one is just sorta interesting; http://cowboyprogramming.com/2007/01/05 ... let-holes/
and a little app. may be of interest I have not yet tryed it ; http://crazybump.com/
and attached is a bit of my experiments,. for the coming dungon crawler,. anyone get the film ref.?
Here is some stuff I have found;
http://www.ozone3d.net/tutorials/bump_mapping_p4.php
http://www.dhpoware.com/demos/glslParal ... pping.html
this one is just sorta interesting; http://cowboyprogramming.com/2007/01/05 ... let-holes/
and a little app. may be of interest I have not yet tryed it ; http://crazybump.com/
and attached is a bit of my experiments,. for the coming dungon crawler,. anyone get the film ref.?
- Attachments
-
- dungon_walls_006.zip
- .exe good 'n cheesy!
- (43.9 KiB) Downloaded 736 times
iterationGAMES.com
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
ha, your cool,. that don't help me though. I never played doom 3. .,
The problem I am having working with shader,s is figuring out what values are coming from elseware in ZGE,. and what they are refered to when in a shader? The textures and other material properties, the light, camera position,. etc. guess I will have to go through making little tests,. once I figure these out, I will write up a list of them and post it,. . to help others attempting to work with this.
film ref; I was quoting the Supreme Being at the begining of Time Bandits.
The problem I am having working with shader,s is figuring out what values are coming from elseware in ZGE,. and what they are refered to when in a shader? The textures and other material properties, the light, camera position,. etc. guess I will have to go through making little tests,. once I figure these out, I will write up a list of them and post it,. . to help others attempting to work with this.
film ref; I was quoting the Supreme Being at the begining of Time Bandits.
- Attachments
-
- supremebeing.jpg (3.71 KiB) Viewed 17345 times
iterationGAMES.com
Well if we ask Kjell nicely enough perhaps he will share the zgeproj-file of his example
The only custom variables (except any user-defined variables in Shader.UniformVariables) that ZGE passes to the shaders are "tex1", "tex2", "tex3" that corresponds to the textures of the selected material.
"uniform sampler2D tex1;"
A list of predefined opengl-variables that can be read inside a shader can be found in the GLSL-manual.
The only custom variables (except any user-defined variables in Shader.UniformVariables) that ZGE passes to the shaders are "tex1", "tex2", "tex3" that corresponds to the textures of the selected material.
"uniform sampler2D tex1;"
A list of predefined opengl-variables that can be read inside a shader can be found in the GLSL-manual.
Hey guys,
Since I just copy-pasted the shader directly from oZone3D ( renaming colorMap -> tex1 + normalMap -> tex2 ), I didn't actually save the .zgeproj of that example. But I assume something had gone wrong for jph when trying that?
I can re-create / re-copy-paste the example if you really want though
K
Since I just copy-pasted the shader directly from oZone3D ( renaming colorMap -> tex1 + normalMap -> tex2 ), I didn't actually save the .zgeproj of that example. But I assume something had gone wrong for jph when trying that?
I can re-create / re-copy-paste the example if you really want though
K
Guys do we still need the light component for the bitmap now that we got the bump mapping? ^^
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
...
In case the answer will be yes ( to my own question, not Francesco's ) .. here's the source
K
In case the answer will be yes ( to my own question, not Francesco's ) .. here's the source
K
- Attachments
-
- Bump.zgeproj
- (558.97 KiB) Downloaded 734 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Yeah, I got it working after Ville's post,. I had been getting results without using tex1-3 for other shader hacking so was unsure as to why. But thanks for postin' it Kj!
kattle- hummm,. the light could be usefull for drawing textures still,. however some way to generate those normal maps would be even MORE usefull,. with a bumpmap shader like this
kattle- hummm,. the light could be usefull for drawing textures still,. however some way to generate those normal maps would be even MORE usefull,. with a bumpmap shader like this
iterationGAMES.com
?
Generate Normal-Maps? A normal map is just a texture like any other ( but with a zero value of R.5G.5B1 ). So as far as procedural bitmap generation goes everything you need is already there.
On the other hand, every artist I know uses either Mudbox or ZBrush to create Normal Maps ( me included ).
K
Generate Normal-Maps? A normal map is just a texture like any other ( but with a zero value of R.5G.5B1 ). So as far as procedural bitmap generation goes everything you need is already there.
On the other hand, every artist I know uses either Mudbox or ZBrush to create Normal Maps ( me included ).
K
he means generate a normal map by inputting a greyscale heightmap... I hate the normals I can even tell you why
They need a nice code much similar to the one the blur needs, but at the same time we are going to change the blur because of speed
Seriously speaking, creating a normal map is so easy it can even be done in a ZExpression... I don't think a component will be that usefull UNLESS used inside a BitmapLight component... and I was thinking about another way of implementing the light component itself.
but time will tell ^^ I'm going to try a lot of stuff in the upcoming weeks!
They need a nice code much similar to the one the blur needs, but at the same time we are going to change the blur because of speed
Seriously speaking, creating a normal map is so easy it can even be done in a ZExpression... I don't think a component will be that usefull UNLESS used inside a BitmapLight component... and I was thinking about another way of implementing the light component itself.
but time will tell ^^ I'm going to try a lot of stuff in the upcoming weeks!
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Code: Select all
Mudbox = $795.00 CAD
ZBrush = $738.87 CAD
Yeah I know a normal map is STORED as a bitmap however it is based on 3 axii of normal data,. not something that is easy to visualise,. let alone come up with an easy way to generate,. . attached is an simple test, just mixeing offset shapes.
Yup Kattle "generate a normal map by inputting a greyscale heightmap" tis' just what I mean! (wek,TG, et al) we'll see if your normal/light can be realised.., was looking at TG and the 'light' uses the normal map to render the lighting,. . so, seems to work in the reverse order to what I think you are saying? (sample_crystal.xml)
iterationGAMES.com
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
.zgeproj normal generation test 1.
Code: Select all
Mudbox = $795.00 CAD
ZBrush = $738.87 CAD
Yeah I know a normal map is STORED as a bitmap however it is based on 3 axii of normal data,. not something that is easy to visualise,. let alone come up with an easy way to generate,. . attached is an simple test, just mixeing offset shapes.
Yup Kattle "generate a normal map by inputting a greyscale heightmap" tis' just what I mean! (wek,TG, et al) we'll see if your normal/light can be realised.., was looking at TG and the 'light' uses the normal map to render the lighting,. . so, seems to work in the reverse order to what I think you are saying? (sample_crystal.xml)
- Attachments
-
- normal_generation_000.zgeproj
- .zgeproj normal generation test 1.
- (5.21 KiB) Downloaded 676 times
iterationGAMES.com
Hey jph,
There are a couple of open / free alternatives to Mudbox / ZBrush, but haven't tried any of them. Blender seems to be the safest choice though. If you do have $100 to spare, Silo or Curvy3D seem to be solid choices.
But I agree, Mario 64 didn't have any fancy shaders ( not even skinning ) and that game still looks great.
And I understand that writing a expression to generate a height map might be easier then a normal map, but a Parallax shader ( the Doom3 thing ) actually uses a height map for it's "bump" effect .. not just a normal map. This is a different effect then the oZone3D example.
Just to be clear ..
http://en.wikipedia.org/wiki/Normal_mapping
http://en.wikipedia.org/wiki/Parallax_mapping
K
There are a couple of open / free alternatives to Mudbox / ZBrush, but haven't tried any of them. Blender seems to be the safest choice though. If you do have $100 to spare, Silo or Curvy3D seem to be solid choices.
But I agree, Mario 64 didn't have any fancy shaders ( not even skinning ) and that game still looks great.
And I understand that writing a expression to generate a height map might be easier then a normal map, but a Parallax shader ( the Doom3 thing ) actually uses a height map for it's "bump" effect .. not just a normal map. This is a different effect then the oZone3D example.
Just to be clear ..
http://en.wikipedia.org/wiki/Normal_mapping
http://en.wikipedia.org/wiki/Parallax_mapping
K