About Store Forum Documentation Contact



Post Reply 
(solved)MyProject.exe can't find custom shader
Author Message
3DRaddict Offline
Member

Post: #1
(solved)MyProject.exe can't find custom shader
Until now I've been running all my compiled projects containing custom shaders from the EE Code Editor. For the first time today I published one of my projects, but when I attempted to run its .exe from the '_Publish_' folder I get the message Can't load Shader "User/Custom Shader" .
Where must I place the compiled custom shader so that it will be loaded by application executable?
(This post was last modified: 11-21-2014 05:19 AM by 3DRaddict.)
11-19-2014 10:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: MyProject.exe can't find custom shader
Hi,

For the moment I think the only solution would be to manually include it in your pak file, using PakUpdate function on an existing pak file.
This will be improved in the future once I implement the new shader system with the integrated editor.
11-19-2014 01:24 PM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #3
RE: MyProject.exe can't find custom shader
Thanks, Esenthel, but that does not really help me too much as I'm at a loss as to how to use:
PHP Code:
// Update Pak
Bool PakUpdate(Pak &src_pakC Memp<PakFileData> &update_filesC Str &pak_nameSecure *dest_secure=NULLCOMPRESS_TYPE compress=COMPRESS_NONEInt compression_level=9); // update 'src_pak' by adding 'update_files' and saving the new Pak into 'pak_name', 'compression_level'=(0..9) (0=fastest/worst, 9=slowest/best), if compression is enabled then all files will be compressed (including uncompressed files from 'src_pak') 

My file reading/writing abilities do not go far beyond the more simple stuff.
I've been unable to find any examples of Pak reading/writing, so if anyone here understands this procedure, I'd be extremely grateful if you could kindly post up a code snippet for me so that I might accomplish this task... smile
11-19-2014 03:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #4
RE: MyProject.exe can't find custom shader
Thanks, aceio76, for that kickstart...I'll see how far I can progress with it.
I've always tried to avoid any C++ code where I see the template designations <....>, but I guess if I'm to make any headway with Esenthel coding, I've got to start facing them sooner rather than later. So, forgive me for an obvious-to-some question, but in your snippet: how do I determine the 'SomeObjectType' and 'objBasedOnSomeObjectType' ?
And how do I determine what type a particular object is? Does my custom shader qualify as an object?
I'm in the process of googling C++ templates, but it would help if you (or anyone)
could supply a quick and simple answer to the above questions. Thanks for your assistance.
(This post was last modified: 11-20-2014 02:37 PM by 3DRaddict.)
11-19-2014 06:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #5
RE: MyProject.exe can't find custom shader
I'm getting sooo frustrated...!!

I've been at it all morning, with just no headway

Here is what I've been trying:

PHP Code:
Memb<PakFileDatashaderfile
  
  
PakFileData &pfd=shaderfile.New();
  
pfd.name="User/Custom Shader"
  
pfd.file2="User/Custom Shader";
    
  
Pak pak;
  
pak.load("Bin/Project.pak"); // load the source pak
  
PakUpdate(pakshaderfile"Bin/Project.pak"); // update the pak with the 'User/Custom Shader' file 

The 'Project.pak' is the file in the "_Publish_/myProject/Bin" folder
This is the pak file which has to be updated with my custom shader file (called "Custom Shader") which is held in a folder called "User" off the "Bin" folder.
Running the above code does increase the size of "Project.pak", so something has been added to it. However, on running my application executable, I'm still getting the original error message "Can't load Shader "User/Custom Shader""

Is the above code correct for the job?
I've tried various combinations, with the same result

This is all so complicated. It would be so much easier if there existed a PakManager tool.
(This post was last modified: 11-20-2014 03:11 PM by 3DRaddict.)
11-20-2014 02:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: MyProject.exe can't find custom shader
@3DRaddict:
For the pfd.file2="User/Custom Shader"; I recommend setting full path (including drive) to the source file.
For the pfd.name="User/Custom Shader"; You have forgotten that custom shaders need to be included in folders like:
"Shader/4/xxx"
in your case:
pfd.name="Shader/4/User/Custom Shader";
11-21-2014 01:29 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #7
RE: (solved)MyProject.exe can't find custom shader
Esenthel to the rescue once more... thank you so much!grin
That was indeed the case!

Perhaps some indication in the error message or documentation as to full path required might prevent others from hitting the same problem.

And also thanks to aceio76 for taking the time to look into the problem and steering me in the right direction.
11-21-2014 05:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply