About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Lightmaps for RM_SIMPLE
Author Message
cmontiel Offline
Member

Post: #1
Lightmaps for RM_SIMPLE
Thanks esenthel for the last sdk update. This is a custom shader for lightmaps + alpha test on RM_SIMPLE renderer mode.

Code:
#include "Main.h"

/******************************************************************************/
// VERTEX SHADER
/******************************************************************************/
void VS
(
   // vertex input
   VtxInput vtx,

   // output
   out Vec4 oPos:POSITION,
   out Vec2 oDiffuseTex:TEXCOORD0,
   out Vec2 oLightTex:TEXCOORD1

)
{
   oDiffuseTex=vtx.tex();
   oLightTex=vtx.tex1();
   oPos=Project(TransformPos(vtx.pos4()));
}
/******************************************************************************/
// PIXEL SHADER
/******************************************************************************/
Vec4 PS
(
   Vec2 DiffuseTex:TEXCOORD0,
   Vec2 LightTex:TEXCOORD1
):COLOR
{
    // Alpha test
    if(Tex(Col, DiffuseTex).a<1.f-MaterialColor().a)
        discard;

        // Diffuse texture color * Material Color * Lightmap color
    return Vec4(Tex(Col, DiffuseTex).rgb * MaterialColor().rgb * Tex(Lum, LightTex).rgb,1.f);
}
/******************************************************************************/
// TECHNIQUE
/******************************************************************************/
TECHNIQUE(Main, VS(), PS());
/******************************************************************************/

And the screenshots:
iOS
[Image: 2w5ujwz.png]

Android
[Image: 2yv6txl.png]

Both running at 60 fps.

IRC: irc.freenode.net
Channel: #Esenthel
01-29-2013 10:21 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Lightmaps for RM_SIMPLE
Cool screen.

You've motivated me into adding lightmap support for all renderers in next SDK smile
02-01-2013 06:02 PM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #3
RE: Lightmaps for RM_SIMPLE
Haha nice!

IRC: irc.freenode.net
Channel: #Esenthel
02-01-2013 06:17 PM
Find all posts by this user Quote this message in a reply
Post Reply