[SOLVED] Multitexturing

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
LightDark
DCEmu Fast Newbie
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

Post by LightDark »

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.
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Multitexturing

Post by PH3NOM »

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?
Simplify the concept. The mesh itself contains geometry; everything else is just various texture maps applied on top.
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?
User avatar
LightDark
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 18
Joined: Sat Mar 09, 2013 4:39 pm
Has thanked: 0
Been thanked: 1 time

Re: Multitexturing

Post by LightDark »

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 :mrgreen: !

Image
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Multitexturing

Post by PH3NOM »

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 :mrgreen: !
Awesome, glad to help!

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 8-)

Also, I had posted a thread in the past of multi-texture on the pvr here:
viewtopic.php?f=29&t=102327
User avatar
LightDark
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 18
Joined: Sat Mar 09, 2013 4:39 pm
Has thanked: 0
Been thanked: 1 time

Re: [SOLVED] Multitexturing

Post by LightDark »

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
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?
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: [SOLVED] Multitexturing

Post by PH3NOM »

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!
Post Reply