[SOLVED] Multitexturing
- LightDark
- DCEmu Fast Newbie
- Posts: 18
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Sat Mar 09, 2013 4:39 pm
- Has thanked: 0
- Been thanked: 1 time
[SOLVED] Multitexturing
Hi I'm currently working on a dynamic lighting engine for Dreamcast and I've got to a point where I want to incorporate Bump mapping/Normal mapping however from what I've read the PowerVR has no native support for multitexturing which means I have to submit the geometry for the mesh twice (one for the mesh itself and it's texture and one for the Normal Map texture). My question is say I have a 640x480 scene of 32x32 triangle strip quads or tiles and each tile has the same texture applied to it, the tiles are rendered on the Translucent or Punch Through list and the normal map is rendered on the Opaque list using the same geometry, how would I go about blending the two textures so the bump map shows?
Last edited by LightDark on Tue Jul 01, 2014 10:56 pm, edited 1 time in total.
- PH3NOM
- DC Developer
- Posts: 576
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
Re: Multitexturing
Simplify the concept. The mesh itself contains geometry; everything else is just various texture maps applied on top.LightDark wrote:Hi I'm currently working on a dynamic lighting engine for Dreamcast and I've got to a point where I want to incorporate Bump mapping/Normal mapping however from what I've read the PowerVR has no native support for multitexturing which means I have to submit the geometry for the mesh twice (one for the mesh itself and it's texture and one for the Normal Map texture).]My question is say I have a 640x480 scene of 32x32 triangle strip quads or tiles and each tile has the same texture applied to it, the tiles are rendered on the Translucent or Punch Through list and the normal map is rendered on the Opaque list using the same geometry, how would I go about blending the two textures so the bump map shows?
The Normal Map should have the same geometry as the mesh, so do not think of them as two separate things, rather a different version of the same thing.
Also it seems you have things backwards: The Basic Texture should be Opaque, and the bump/normal should be Translucent.
Basic Overview:
Pass 1: Opaque List: (Render Mesh) + Base Texture
Pass 2: Translucent List: (RenderMesh) + Alpha Texture( Normal, Light, Etc. );
Do you need info on submission to the PVR or do you already understand the different PVR vertex structure types, etc?
- LightDark
- DCEmu Fast Newbie
- Posts: 18
- Joined: Sat Mar 09, 2013 4:39 pm
- Has thanked: 0
- Been thanked: 1 time
Re: Multitexturing
Thank you very much for your help! I have got everything working the way I want it too now! Sorry for this late reply, I wanted to take a photo to show it. I made the quads 128x128 so the Dreamcast swirl normal map would be more noticeable. The scene I'm rendering currently has 1 light that isn't emitting light but it's position affects the normal maps and 1 omnidirectional diffuse light emitting white light. Also I think I have you to thank for pointing me to this tutorial in another thread, it taught me how to do per-vertex lighting !
- PH3NOM
- DC Developer
- Posts: 576
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
Re: Multitexturing
Awesome, glad to help!LightDark wrote:Thank you very much for your help! I have got everything working the way I want it too now! Sorry for this late reply, I wanted to take a photo to show it. I made the quads 128x128 so the Dreamcast swirl normal map would be more noticeable. The scene I'm rendering currently has 1 light that isn't emitting light but it's position affects the normal maps and 1 omnidirectional diffuse light emitting white light. Also I think I have you to thank for pointing me to this tutorial in another thread, it taught me how to do per-vertex lighting !
I was going to point you to the link here for bump-mapping:
viewtopic.php?p=816595
but looking at your normal map it seems you have already seen that
Also, I had posted a thread in the past of multi-texture on the pvr here:
viewtopic.php?f=29&t=102327
- LightDark
- DCEmu Fast Newbie
- Posts: 18
- Joined: Sat Mar 09, 2013 4:39 pm
- Has thanked: 0
- Been thanked: 1 time
Re: [SOLVED] Multitexturing
Yes! It's the only thing I could find on the topic. Can I ask what would be the proper way to affect the normal map based upon multiple light sources using the example linked in the thread?I was going to point you to the link here for bump-mapping:
viewtopic.php?p=816595
but looking at your normal map it seems you have already seen that
- PH3NOM
- DC Developer
- Posts: 576
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
Re: [SOLVED] Multitexturing
To be honest, I have not done much with the Bump Mapping on the PVR.
But that was one limitation I was going to mention, from what I can tell the PVR's Bump Mapping only allows for the parameters of one light source to be passed in.
I imagine you could submit multiple bump maps ( one per light source, that is ), overlaid on top of each other using additive blending to achive the effect of a single material reflecting multiple light sources. This could get expensive in terms of render time.
Another idea ( depending on the type of lights you are using ) it might be possible to average the color and position of the light sources, then use the averaged light source as the input to the bump parameters.
Good luck!
But that was one limitation I was going to mention, from what I can tell the PVR's Bump Mapping only allows for the parameters of one light source to be passed in.
I imagine you could submit multiple bump maps ( one per light source, that is ), overlaid on top of each other using additive blending to achive the effect of a single material reflecting multiple light sources. This could get expensive in terms of render time.
Another idea ( depending on the type of lights you are using ) it might be possible to average the color and position of the light sources, then use the averaged light source as the input to the bump parameters.
Good luck!