About Store Forum Documentation Contact



Post Reply 
[SOLVED] Specular, HDR noob question
Author Message
Marbasoft Offline
Member

Post: #1
[SOLVED] Specular, HDR noob question
Hello,

I've a problem with specular/HDR don't really know as you can see in the screenshot below, in EE World Editor all is ok.

[Image: inEEWE.png]


But in game :

[Image: ingame.png]



Here is my draw / render code :

PHP Code:
void RenderGame()
{
   
Game.World.draw(); // draw world (this is done outside of 'switch(Renderer())' because world automatically detects active rendering mode)
   /*
   switch(Renderer())
   {
      case RM_PREPARE:
      {
         player1.drawPrepare();
         player2.drawPrepare();
      }break;
   }
   */
}
void DrawGame()
{
   
Gui.draw();
   if(
BL.draw())return; // this needs to be at the start of 'Draw' function
   
   
   
Renderer(RenderGame);
   
   
/*
   D.text(0, +0.00, S+"dist  : " + Cam.dist);
   D.text(0, -0.08, S+"pitch : " + Cam.pitch);
   D.text(0, -0.16, S+"roll  : " + Cam.roll);
   D.text(0, -0.24, S+"yaw   : " + Cam.yaw);
   D.text(0, -0.32, S+"at    : " + Cam.at);
   D.text(0, -0.40, S+"pos   : " + Cam.matrix.pos);
   */



I tried to turn off HDR, but nothing changed, i tried to remove the specular map on the dragon, nothing changed too...

Someone know what i'm doing wrong ??



PS : After some test, it seem it's due to material with technique : Alpha test...
I changed the techinque for the hair of the sorceress to "Blend" and now the sorceress is ok
(This post was last modified: 08-01-2014 02:41 PM by Marbasoft.)
07-29-2014 10:32 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Specular, HDR noob question
Hi,

This looks like glow effect and not specular.
I could investigate this if you could provide me your project. With steps on how to reproduce the issue.
Thank you
07-30-2014 03:55 AM
Find all posts by this user Quote this message in a reply
Marbasoft Offline
Member

Post: #3
RE: Specular, HDR noob question
(07-30-2014 03:55 AM)Esenthel Wrote:  Hi,

This looks like glow effect and not specular.
I could investigate this if you could provide me your project. With steps on how to reproduce the issue.
Thank you

Hum, there's no glow on my material, i'm uploading a test project with the problem, i'll give you the link to download it when it's finished smile

After some try and delete some file in my project to give it to you, the problem wasn't here, except when the camera has a particular angle with the mesh (you'll see it when you'll launch the test)

Edit : Here the link to the project (30Mb) : http://www.marbas.fr/esenthel/pb/4q09l-x...^90tx-.rar
(This post was last modified: 07-30-2014 09:11 AM by Marbasoft.)
07-30-2014 08:58 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #4
RE: Specular, HDR noob question
I checked it out as well - when I turn the camera away from the dragon until only part of it, it makes like a sun and glows.

I have a similar problem with shadows when using the light palette; it looks like it has something to do with the bump. Turning bump mode to flat eradicates both the shadow issue I've been experiencing, as well as the mega-glow.
07-31-2014 04:24 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Specular, HDR noob question
Thank you for reporting the issue.
I'm confirming to have this problem when starting the app in DX10+, but not DX9.
I'll try to fix it ASAP. Are you also having this issue only in DX10+? (please use "Clean/Rebuild" after switching targets to compile just to be sure that the proper config is compiled).
07-31-2014 06:06 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Specular, HDR noob question
The fix is now available in source version.
The binary version is being uploaded now.

@Rubeus: could you provide a sample code/data/project to reproduce your issue?
Thanks smile
07-31-2014 07:38 AM
Find all posts by this user Quote this message in a reply
Marbasoft Offline
Member

Post: #7
RE: Specular, HDR noob question
(07-31-2014 06:06 AM)Esenthel Wrote:  Thank you for reporting the issue.
I'm confirming to have this problem when starting the app in DX10+, but not DX9.
I'll try to fix it ASAP. Are you also having this issue only in DX10+? (please use "Clean/Rebuild" after switching targets to compile just to be sure that the proper config is compiled).

I have the problem only in DX10+ too smile
07-31-2014 07:58 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #8
RE: Specular, HDR noob question
(07-31-2014 07:38 AM)Esenthel Wrote:  The fix is now available in source version.
The binary version is being uploaded now.

@Rubeus: could you provide a sample code/data/project to reproduce your issue?
Thanks smile

This is just the cell shading tutorial without the randoms. It's not 100%, but it's pretty close when in DirectX9. I think I may have been mistaken about the Bump settings, as turning it off didn't help.
Also, I'm not sure if it's just something odd with my hardware.
Code:
/******************************************************************************/
class Obj
{
   Vec      pos;
   Material mtrl;

   void create() {pos=VecZero; mtrl.reset().color.v3()=ColorHue(.5).asVec(); mtrl.validate();}
   void draw  () {MaterialLock=&mtrl; ball.draw(pos); MaterialLock=null;}
}

Mesh ball;
Obj  obj;
/******************************************************************************/
void InitPre()
{
   EE_INIT();
   App.flag=APP_MS_EXCLUSIVE;
   D.ambientPower(0);
}
/******************************************************************************/
bool Init()
{
   // set cel shading
   D.bumpMode  (BUMP_FLAT      ); // cel-shading works best with flat bump mapping
   D.hpRt      (true           ); // cel-shading works best with high precision render targets
   D.edgeDetect(EDGE_DETECT_FAT); // set edge detection
   Renderer.cel_shade_palette=UID(870572307, 1257265829, 2574792609, 949141860); // set light palette which modifies global lighting

   // set sky, material and mesh
   Sky.atmospheric();

   ball.parts.New().base.create(Ball(0.5), VTX_TEX0|VTX_NRM|VTX_TAN);
   ball.setRender().setBox();

   obj.create();

   Cam.dist=10;

   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   CamHandle(0.01, 100, CAMH_ZOOM|(Ms.b(1)?CAMH_MOVE:CAMH_ROT));
  
   return true;
}
/******************************************************************************/
void Render()
{
   switch(Renderer())
   {
      case RM_PREPARE:
      {
         obj.draw();

         LightDir(!Vec(1, -1, 1)).add();
      }break;
   }
}
void Draw()
{
   Renderer(Render);
}
/******************************************************************************/
   
08-01-2014 03:15 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: Specular, HDR noob question
Thanks smile
Please let me know if this fixes it:
https://github.com/Esenthel/EsenthelEngi...63d023397b
08-01-2014 07:29 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #10
RE: Specular, HDR noob question
That appears to have done the trick. I must say that even after all this time I'm still impressed by your ability and speed. I won't say any more because I don't want it to go to your head. ;-)
08-01-2014 01:40 PM
Find all posts by this user Quote this message in a reply
Post Reply