About Store Forum Documentation Contact



Post Reply 
Engine Shader Tutorial ?
Author Message
SamerK Offline
Member

Post: #1
Engine Shader Tutorial ?
Hi, I just purchased Engine Shader headers, is there any available tutorials around? I searched the forum but couldn't find any...

Thanks
(This post was last modified: 07-23-2013 09:47 PM by SamerK.)
07-23-2013 09:47 PM
Find all posts by this user Quote this message in a reply
SamerK Offline
Member

Post: #2
RE: Engine Shader Tutorial ?
Ok, I found through forum that Shaders Tutorials are available for engine sdk users, any chance to have them for Esenthel 2.0 users? at least for who bought the Headers.

Thanks

SamerK
(This post was last modified: 07-24-2013 04:01 PM by SamerK.)
07-24-2013 03:32 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Engine Shader Tutorial ?
Hi,

Currently creating shaders for 2.0 can be a little cumbersome, because for 2.0 I've planned to create an integrated shader editor (which is not yet available).

Therefore you'll need to manually copy some files from the attached package, and adjust the codes to set correct paths for:
-shader source - HLSL code (to the "Shader HLSL" folder from the package)
-shader destination - folder that points into your "{Project}/Game/Shader" folder

First to your project folder, copy one of the folders from the package, so you have:
"{Project}/Game/Shader/2/User"
"{Project}/Game/Shader/3/User"
"{Project}/Game/Shader/4/User"
"{Project}/Game/Shader/GL/User"


Attached File(s)
.rar  EE 2.0 Sample Shaders.rar (Size: 13 KB / Downloads: 84)
07-25-2013 11:46 AM
Find all posts by this user Quote this message in a reply
SamerK Offline
Member

Post: #4
RE: Engine Shader Tutorial ?
Thank you Esenthel I will start testing today. Also its great news to know that there will be shader editor for EE 2.0.
07-25-2013 02:46 PM
Find all posts by this user Quote this message in a reply
Biga Offline
Member

Post: #5
RE: Engine Shader Tutorial ?
hi, where is this item in store? I dont find it, maybe it was only for EE1?
in EE2 I need to have source license to access the headers to compile the sample shaders you posted above?
(material_user_shader.enum.h)

from pdf:
"Using custom shaders is available only for licensed developers, if you're a licensed developer then please:
Download the Shader Archive available in the "EsenthelEngine Forum\Clients
Section\Source Codes"

licensed developers here meant owning binary or source license?
05-23-2014 12:49 PM
Find all posts by this user Quote this message in a reply
SamerK Offline
Member

Post: #6
RE: Engine Shader Tutorial ?
Hi Biga, I purchased it when I was using EE2.0, I think its also available for purchase to binary/source license members.
05-23-2014 01:08 PM
Find all posts by this user Quote this message in a reply
Biga Offline
Member

Post: #7
RE: Engine Shader Tutorial ?
thx. yeah seems here is organisational problem smile
our team leader bought 2 binary licenses but license can only related to user was logged in when paid.
so I appear as demo user and probably I dont see that item...

our team leader didnt see with binary license account.
maybe it needs source license?
(This post was last modified: 05-23-2014 02:12 PM by Biga.)
05-23-2014 02:06 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Engine Shader Tutorial ?
Hi,

I've removed the shader headers from sale as separate items some time ago, they're now included only in the source version.
I've decided to do that because having the source version is currently the best way to customize your shaders.
In the future shaders for binary licensees will also be possible, but I'd need to redesign the shader system and make a shader editor for that (this will take time).

Thanks
05-24-2014 02:15 AM
Find all posts by this user Quote this message in a reply
Biga Offline
Member

Post: #9
RE: Engine Shader Tutorial ?
thx for the info.
05-24-2014 06:25 AM
Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #10
RE: Engine Shader Tutorial ?
Sorry but limiting the shader headers to source licencees only sounds like a bad idea to me. I know that as a hobbyist i couldn't sub to the source only to gain shader access and shaders was an important aspect for me.
Luckily i managed to buy them before that.

Edit : Then again i understand that the shader system is not easy to use right now and will be much better in the future. Still no reason to take them out of the store.
(This post was last modified: 05-24-2014 01:22 PM by georgatos7.)
05-24-2014 09:29 AM
Find all posts by this user Quote this message in a reply
Biga Offline
Member

Post: #11
RE: Engine Shader Tutorial ?
we have now the source license, but still cant build shader tutorials.

Code:
1>Source\Main.cpp(6): fatal error C1083: Cannot open include file: '../../../../../data/enum/material_user_shader.enum.h': No such file or directory

this file doesnt exist in source distribution...
nor the referenced one in tutorials: Data\Shader\Main.h
05-27-2014 12:03 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
RE: Engine Shader Tutorial ?
Hi,

That file was present in 1.0 package, but not in the later versions.
I've updated the RAR archive above to include it, and it's now present in the "Shader CPP" folder.
05-27-2014 09:55 PM
Find all posts by this user Quote this message in a reply
Biga Offline
Member

Post: #13
RE: Engine Shader Tutorial ?
thanks, now I built it successfully.
when I tried to run, it shows "Can't load engine.pak".
after commenting Paks.add("engine.pak"); line, this error disappeared.
now I get "Can't load shader Main" message at run.

what I did:

1. from the above rar, I unpacked the "Copy contents..." folder to my project folder - I assume they will be the empty folders for shader compilation
2. unpacked Shader HLSL to a folder
3. created a new application with the "01 - Shader creation.cpp", and replaced shader source folder in CompileShaders to what I used in 2.
4. Unpacked material_user_shader.enum.h to a specific folder and referred to it in #include
5. Build and run

Tried to debug in VS, the error popups before entering to CompileShaders.
05-28-2014 01:49 PM
Find all posts by this user Quote this message in a reply
Biga Offline
Member

Post: #14
RE: Engine Shader Tutorial ?
AHA
commenting engine.pak was of course bad move, I uncommented and set a proper path for engine pak. now I'm getting shader compiler errors, but thats an advance already, so now I focus to them...

well seems for now I cant figure where is this EsenthelEngineShader folder what I have to update in main.h file...
(This post was last modified: 05-28-2014 04:58 PM by Biga.)
05-28-2014 04:42 PM
Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #15
RE: Engine Shader Tutorial ?
You follow the steps below.

Folder-File Structure.

C:\Projects\EsenthelEngineShader\(move the appropriate rar files here)
C:\Projects\Shader CPP\(move the appropriate rar files here)
C:\Projects\Shader HLSL\(move the appropriate rar files here)
C:\Projects\material_user_shader.enum.h

C:\ESENTHEL\Projects\(your project's folder e.x. !h4kif3gxoo270!s45ai7a1t)\Game\Shader\2\User
C:\ESENTHEL\Projects\(your project's folder)\Game\Shader\3\User
C:\ESENTHEL\Projects\(your project's folder)\Game\Shader\4\User
C:\ESENTHEL\Projects\(your project's folder)\Game\Shader\GL\User

Now in the Esenthel Code
Code:
/****************/
#include "stdafx.h"
#include "c:/Projects/material_user_shader.enum.h"
/****************/

void InitPre()
{      
   Paks.add("C:/Esenthel/Bin/engine.pak");
   DataPath("C:/Esenthel/Projects/(your project's folder)/Game/");
   ...
}

//In order to compile the shader code to the binary form.
void CompileShaders()
{
   if(D.shaderModel()==SM_GL)
   {
      ShaderCompile("C:/Projects/Shader HLSL/2D Shader.cpp", S+DataPath()+"Shader/GL/User/Custom Shader", SM_GL);
   }else
   if(D.shaderModel()>=SM_4)
   {
      ShaderCompile("C:/Projects/Shader HLSL/2D Shader.cpp", S+DataPath()+"Shader/4/User/Custom Shader", SM_4);
   }else
   {
      ShaderCompile("C:/Projects/Shader HLSL/2D Shader.cpp", S+DataPath()+"Shader/2/User/Custom Shader", SM_2);
      ShaderCompile("C:/Projects/Shader HLSL/2D Shader.cpp", S+DataPath()+"Shader/3/User/Custom Shader", SM_3);
   }
}

//This is how you call a shader technique and draw it on the screen.
void Draw()
{
   Shaders("User/Custom Shader").getTech("CustomTechnique").draw(null, null);
}

I hope i didn't forget anything. Let me know if you manage to do anything.
Also you can customize the sctructure to what you want later on but until you got something working stick to the one i wrote above.
(This post was last modified: 05-28-2014 06:42 PM by georgatos7.)
05-28-2014 06:38 PM
Find all posts by this user Quote this message in a reply
Post Reply