Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to use more than 2 graphic passes?

Author
Message
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 21st May 2012 00:04
Right now I've got a 3d level which is both light mapped and textured. I'd also like to add some sphere mapping or bump mapping or something to make it look a little shiny.
The problem I'm having is that whenever I apply a sphere map it wipes out the texture completely, and replaces that with the light map.
When I try using various shaders I get the same results.
Is there any way to do this?

http://mattsmith.carbonmade.com/
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st May 2012 01:39
Yeah, you have to modify the bump or sphere mapping shader to combine the lightmap texture with the diffuse texture. It's both a good and bad thing with shaders that each one controls practically the entire rendering pipeline, so what's described as a bump-mapping shader also controls everything from how the textures are blended to how the vertices are transformed.

Presumably the lightmapping requires texture stage 0 to be the diffuse and stage 1 to be the lightmap, and the bump mapping probably requires stage 0 to be the diffuse and stage 1 to be the bump map. You will need to modify the shader so that it does both the lightmapping and the bumpmapping and expects either the lightmap or the bump map to be on stage 2.

Also, bump-mapping doesn't make things look shiny, it makes them look bumpy

[b]
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 21st May 2012 01:54
Thanks for you reply, do you know how I would go about modifying the shader? For example, here's the halo.dbs file code, what parts should I change?


I think my concept of bump mapping comes from Oblivion, where the walls had that nice wet/shiny/bumpy look.

http://mattsmith.carbonmade.com/
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 21st May 2012 04:22 Edited at: 21st May 2012 04:23
Or if anyone can tell me how, I'd be just as happy to load my textured+lightmapped object and set sphere mapping on it from within db.
Just so long as I don't get this:



http://mattsmith.carbonmade.com/
david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 21st May 2012 05:22
The "shine" comes for the specular component in the lighting calculation and has nothing to do with bump mapping, sphere mapping or any other kind of "mapping".
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 31st May 2012 01:40 Edited at: 31st May 2012 01:43
Quote: "The "shine" comes for the specular component in the lighting calculation"

"Specular Map" I think is the most commonly used shader method. So If the bump shader has one of those, that's it.


More Information About Bump Mapping:
All Bump Mapping does is allows you to have a simple surface, like a flat wall or a low poly person, and add more lighting and shadow detail without adding more vertices or polygons.

So a completely flat wall can have a brick texture, and depending where the lights are, cast shadows inside the grooves. Or a person can have the same for their body features or clothing, so they don't look painted on.

The effect makes the surface of these objects "pop" out a bit. They look like they have more detail and depth. However the surfaces remain completely flat. When viewed on an angle, you can see the effect is not actually popping out, and is in fact flat.

The bigger brother of Bump Mapping is Tessellation. A more advanced technique that actually adds the geometric detail in realtime as you get closer. It is not a texture effect on a flat surface like Bump Mapping. So the brick details for example actually do pop out of the wall.

The older method Bump Mapping somewhat replaces is "Discrete Level of Detal" (DLOD) where versions of the same object are loaded with different geometric detail levels, and depending on how far away the view is, the version of the object with the proper level of detail is selected and drawn. fyi


Login to post a reply

Server time is: 2026-07-08 12:26:13
Your offset time is: 2026-07-08 12:26:13