Mixing Lite-C shaders with C-script does not work in A8?

Posted By: CodeMaster

Mixing Lite-C shaders with C-script does not work in A8? - 08/07/12 12:58

hi,

is there any chance to use the lite-c shaders in my c-script project. I have already tried to find out more about this but unfortunately no one could give me some information that would help. Earlier we was able to mix it in A7 (there is a one example in Aum100 or this thred ), but after version A7.50 this is no longer possible. What are the changed in engine that this no longer works? Is there any other way to mix lc with c-script?
Posted By: jcl

Re: Mixing Lite-C shaders with C-script does not work in A8? - 08/07/12 16:03

Shaders have nothing to do with lite-C, they use the HLSL language. But C-Script has no postprocessing functions, so you can only use surface shaders in C-script.
Posted By: CodeMaster

Re: Mixing Lite-C shaders with C-script does not work in A8? - 08/07/12 21:19

i finally got a response from the right person but i think you not understand me jcl. I have already combined the c-script and lite-c, so that i could have a bloom, shade-c hdr, although i still using the c-script.
I managed to combine c-script and lite-c:

on begining my main c-script i has

include <HCS_PP.c>;

beacuse my function main is in c-script and lite-c can't see actions assigned in wed or c-script i make startup function on next way. This is my HCS_PP.c lite-c script (complete demo with soruce can be found in Aum100):

Code:
#define PRAGMA_PATH "shade-c"

#include <acknex.h>
#include <default.c>

#include "mtlView.c"


MATERIAL* mtlGS_Bleach = { effect = "pp_bleach.fx";}

MATERIAL* mtlGS_Color = { effect = "pp_colorshift.fx";}

MATERIAL* mtlGS_Desat = { effect = "pp_desaturate.fx";}

VIEW* viewGS_Color = { material = mtlGS_Color;    flags = CHILD | PROCESS_TARGET; }
VIEW* viewGS_Blech = { material = mtlGS_Bleach; flags = CHILD | PROCESS_TARGET; } 
VIEW* viewGS_Desat = { material = mtlGS_Desat; flags = CHILD | PROCESS_TARGET; }

#include "sc_core.c";

function start_pp()
{
	sc_setup();
	sc_bHDR = 1;
}

void sc_startup() 
{
	viewGS_Color.material.skill1 = floatv(10);
	viewGS_Color.material.skill2 = floatv(10);
	viewGS_Color.material.skill3 = floatv(9);
	viewGS_Blech.material.skill1 = floatv(20);

	start_pp();
	turb_speed=2;
	while(1){
	if ((key_comma)&&(gammahold==0)&&((gamstart-10)>70)){
		gammahold=1;
		gamstart	-=10;
		wait(-0.5);
		video_gamma = gamstart;
		gammahold=0;
	}
	if ((key_period)&&(gammahold==0)&&((gamstart+10)<160)){
		gammahold=1;
		gamstart	+=10;
		wait(-0.5);
		video_gamma = gamstart;
		gammahold=0;
	}
	wait(1);
	}
}



this working a very good and stable in a7, but now when i want to combine this in a8, i just got a error after start code.
i can't back on a7 beacuse you already fix some bugs with whom i had problems in a7. Also i can not translate my game into lite-c beacuse my code is too complex and TOO big (i tried milion times but without luck). This is my last chance to have a nice shaders in my finished game.
Is there any solution to combine again lc and c-script in a8, as i could in a7.50??
Posted By: FBL

Re: Mixing Lite-C shaders with C-script does not work in A8? - 08/07/12 21:24

#include "sc_core.c";

remove the ;
Posted By: jcl

Re: Mixing Lite-C shaders with C-script does not work in A8? - 08/08/12 10:20

Including lite-C scripts in a WDL script is officially not supported anymore in A8, but this feature was not removed, and should theoretically still work. But of course you should not have errors in the included script.

Also your included startup function makes no sense. If you include a lite-C script, you can use the included functions, but they won't start by themselves.

Posted By: CodeMaster

Re: Mixing Lite-C shaders with C-script does not work in A8? - 08/08/12 12:11

thanks for your response jcl. i just now after long time back version a7.50 and everything works great. Simply when i start same code in A8 i got error acknex.exe has stopped working. Did you sure that this feature was not removed, beacuse i do not have any other idea why this not working in A8? In A8 no matter what is in the included lite-c script engine will crash.
© 2024 lite-C Forums