How to:Render Target?

Posted By: MMike

How to:Render Target? - 05/27/08 16:18

Hi there.. hum what i use for this? this is a object glow shader. this is just the render target struct, what i use for this? a entity? or what?
texture GlowMap1 : RENDERCOLORTARGET;

sampler GlowSamp1 = sampler_state
{
texture = <GlowMap1>;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
MIPFILTER = NONE;
MINFILTER = LINEAR;
MAGFILTER = LINEAR;
};

texture GlowMap2 : RENDERCOLORTARGET ;
Posted By: Joey

Re: How to:Render Target? - 05/27/08 16:25

this is not an object glow shader but two textures and one sampler written in hlsl. i think it's from fxcomposer?

you can't assign this to anything...
Posted By: MMike

Re: How to:Render Target? - 05/27/08 17:16

no.. its for 3d studio max shader.

The model skin diffuse and such is working, but the real glow effect, is a render to target.. Does Gs have such?
i mean calling texture glow:rendercolortarget will create a target buffer?

how do i aaply the material to the object and at the same time do the post processing target :S
.. Gs shader could work like other programs do.. like fx composer etc.. i see many limitation.. Maybe Conitec could release a full HSLS support Dll no?
Posted By: Joey

Re: How to:Render Target? - 05/27/08 21:24

no it won't. you schdör me. that's not hlsl standard code but max specific stuff. you should seriously read a beginner's tutorial about shaders.
Posted By: MMike

Re: How to:Render Target? - 05/27/08 23:04

hey im telling you.. its 3d max shader fx. I mean i don't know if you know but. 3d max can as shaders .Fx file as materials.. And the glow shader is a FX file, if i import it to render monkey it will work etc.. etc..

I just need to convert of course some materials problemas, the now problem is that. GS is weird with render target. I mean its hard for me to use it.
Butim expert at shader conversion, thgouh creating my own shaders is more difficult.
Posted By: Quad

Re: How to:Render Target? - 05/27/08 23:35

afaik rendermonkey and fx composer are capable of reading/writing MAX spesific stuff.
Posted By: MMike

Re: How to:Render Target? - 05/28/08 00:44

hum but why you say specific?
just need to rename some vars and thats it. .
oh and the string tags that are not used for Gs.
Posted By: Joey

Re: How to:Render Target? - 05/28/08 07:46

if it's just some renaming then you can do it by yourself, for sure?
Posted By: MMike

Re: How to:Render Target? - 05/28/08 10:41

yes and i did.. but i got a problem.

texture GlowMap1 : RENDERCOLORTARGET;

sampler GlowSamp1 = sampler_state
{
texture = <GlowMap1>;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
MIPFILTER = NONE;
MINFILTER = LINEAR;
MAGFILTER = LINEAR;
};

texture GlowMap2 : RENDERCOLORTARGET ;



The render color target semantics input is not acepted for GS. The glowmap2 won't be considered as a render color target and won't event work, so the fx file wont work if no render target are set. I though about assign somekind of material and then post process it, but this is a Object shader plus post processing using render to texture shader. thus renaming won't work because Gs has no render to texture feature developed like other engines do, that initialaze a render buffer and work with is.

I have TargetMap in A7 but not sure if it will do the job.
Posted By: Joey

Re: How to:Render Target? - 05/28/08 14:25

it will. render to texture is implemented since a6, afaik. that's the problem, you're fiddling with a shader file which works for 3ds max and you think that it's standard compliant, though it isn't. you need to code some lines in lite-c or c-script to set up a render target.
Posted By: MMike

Re: How to:Render Target? - 05/28/08 15:13

ok i will post the whole code here.

There are some pass, first it takes the ent texture and blurs it horizontal and vertical. Then it renderes that blur outpput to a render target that then will be merged on the buffer screen, so you can thee that the object has a glow blur coming out.

Will the render target work in A6?
THIS is the Glow shader. HSLS.

the tecnique part is not fully complete since i tested pass by pass.


// 3ds max effect file
// Glow Effect - updated to support 3ds max autoui.
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Note: This effect file works with EffectEdit.
//

// texture
texture entSkin1;

matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;
matrix matView;


// light direction (view space)
float3 LightDir : Direction = normalize(float3(0.0f, 0.0f, 1.0f));

// glow parameters
float4 GlowColor = {0.5f, 0.2f, 0.2f, 1.0f};

float4 GlowAmbient = {0.2f, 0.2f, 0.0f, 0.0f};
float GlowThickness= 0.015f;

struct VSTEXTURE_OUTPUT
{
float4 Position : POSITION;
float4 Diffuse : COLOR;
float2 TexCoord : TEXCOORD0;
};

// draws unskinned object with one texture and one directional light.
VSTEXTURE_OUTPUT VSTexture
(
float4 Position : POSITION,
float3 Normal : NORMAL,
float2 TexCoord : TEXCOORD0
)
{
VSTEXTURE_OUTPUT Out = (VSTEXTURE_OUTPUT)0;

float3 L = -LightDir; // light direction (view space)
float3 P = mul(Position, matWorldView); // position (view space)
float3 N = normalize(mul(Normal, (float3x3)matWorldView)); // normal (view space)

Out.Position = mul(float4(P, 1), matWorldViewProj); // projected position
Out.Diffuse = max(0, dot(N, L)); // diffuse
Out.TexCoord = TexCoord; // texture coordinates

return Out;
}

struct VSGLOW_OUTPUT
{
float4 Position : POSITION;
float4 Diffuse : COLOR;
};

// draws a transparent hull of the unskinned object.
VSGLOW_OUTPUT VSGlow
(
float4 Position : POSITION,
float3 Normal : NORMAL
)
{
VSGLOW_OUTPUT Out = (VSGLOW_OUTPUT)0;

float3 N = normalize(mul(Normal, (float3x3)matWorldView)); // normal (view space)
float3 P = mul(Position, matWorldView) + GlowThickness * N; // displaced position (view space)
float3 A = float3(0, 0, 1); // glow axis

float Power;

Power = dot(N, A);
Power *= Power;
Power -= 1;
Power *= Power; // Power = (1 - (N.A)^2)^2 [ = ((N.A)^2 - 1)^2 ]

Out.Position = mul(float4(P, 1), matWorldViewProj); // projected position
Out.Diffuse = GlowColor * Power + GlowAmbient; // modulated glow color + glow ambient

return Out;
}



technique TGlowOnly
{
pass PGlow
{
// glow shader
VertexShader = compile vs_1_1 VSGlow();
PixelShader = NULL;

// no texture
Texture[0] = NULL;

// enable alpha blending
AlphaBlendEnable = True;
zWriteEnable = true;
//SrcBlend = ONE;
//DestBlend = ONE;

// set up texture stage states to use the diffuse color
ColorOp[0] = SELECTARG2;
ColorArg2[0] = DIFFUSE;
AlphaOp[0] = SELECTARG2;
AlphaArg2[0] = DIFFUSE;

ColorOp[1] = DISABLE;
AlphaOp[1] = DISABLE;
}
}

Posted By: Joey

Re: How to:Render Target? - 05/28/08 19:17

all i see is a vertex shader which displaces the vertices along the view space normals by a given constant. i *think* this code will run directly within the engine but it won't give you a glow effect. there is no blurring part, you see. for blurring, you need pixel shaders. object-only blurring can be done by rendering the models with slight offset (see above) in numberous passes.

i see that you don't give up and you want your code to work with the engine... all i don't hear is: "how does a glow shader in 3d gamestudio work?" how have you learned in school? have you begun a discussion with every teacher telling him that you have something in mind which must be correct? at all costs? i don't want to offend you but i hope you see that the way you're going currently is way too costly for both you and the community. and don't expect other members to reply you so patiently (the lions must still be asleep as it seems wink ).

so... do you want to know how a glow shader in game engines works in principle? and how you can achieve this effect in 3dgs?

can you program hlsl, lite-c or c-script?

joey.
Posted By: MMike

Re: How to:Render Target? - 05/29/08 02:48

yes i can program c-script and hsls
I know it has no pixel shader , because has i said, i removed it from the code, to test pass by pass. I can give the full code wihout renaming the matrix etc..

But i want to lern, yes, how do you apply a glow shader, that glow real.

Sorry for the bad speech.
Posted By: Joey

Re: How to:Render Target? - 05/29/08 08:25

first of all you need a model, an entity, with a second skin which gives you the glowing parts of the model (or an alpha channel on the first skin). during normal camera rendering you're just rendering the model as-is, without the glow. now you need a second camera (or wait for multiple render targets in 7.08 and do the following in the same technique, outputting to COLOR1 instead of COLOR0). this second camera renders all objects which need to glow with the glow skin. this rendered image goes into a bitmap (or the second render target) via the view.bmap parameter.

now comes the actual glow. theoretically you need a7 for that, if you've strong directx coding skills then it should be no problem for you anyways. assign a fragment shader to your rendered image with the glowing parts. gaussian blur in a horizontal and a vertical part (since it's a convolution) for example, or poisson blur. at last you blend your second image over your normal render, either by another fragment pogram or - far more easily - by using the camera.stage render chain stuff.

if you're searching the shader forums you'll even find some finished glow or bloom shaders. you can then see how it's realized in detail.

joey.

edit: you need three or four effects or fx files for glow.
Posted By: MMike

Re: How to:Render Target? - 05/29/08 09:55

Hey thnanks. I just wonder, how you make the second camera just show (skin2-glow).

From the GEMS they render the glow by multyply with alpha skin, and then multyply the first RGB color skin.
Posted By: MMike

Re: How to:Render Target? - 05/31/08 19:02

There is the fx file
This file maynot work ormmaye yes i do't know.

So i assigned render targets (targetmap) texture..

now i asign this to the model i want to glow right?
but how do i make it post process?
i have the A7.07 , but manual its not very clear about this, or is process target just for lite.c?


float3 baseColor : DIFFUSE = {1.0f, 0.6f, 0.2f};

float fIntensity = 1.0f;

float Glowness = 3.0f;

// file texture (surface)


texture entSkin1;

sampler ModelTexSamp = sampler_state
{
texture = <entSkin1>;
AddressU = WRAP;
AddressV = WRAP;
AddressW = WRAP;
MIPFILTER = LINEAR;
MINFILTER = LINEAR;
MAGFILTER = LINEAR;
};

///////////////////////////////////////////////////////////
/////////////////////////////////////// Un-Tweakables /////
///////////////////////////////////////////////////////////


matrix matWorldViewProj;
///////////////////////////////////////////////////////////
///////////////////////////// Render-to-Texture Data //////
///////////////////////////////////////////////////////////

#define RTT_SIZE 128

float TexelIncrement = 1.0f / RTT_SIZE;


texture TargetMap;
float2 Dimensions = { RTT_SIZE, RTT_SIZE };

sampler GlowSamp1 = sampler_state
{
texture = <TargetMap>;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
MIPFILTER = NONE;
MINFILTER = LINEAR;
MAGFILTER = LINEAR;
};



sampler GlowSamp2 = sampler_state
{
texture = <TargetMap>;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
MIPFILTER = NONE;
MINFILTER = LINEAR;
MAGFILTER = LINEAR;
};

texture DepthBuffer : RENDERDEPTHSTENCILTARGET
<
float2 Dimensions = { RTT_SIZE, RTT_SIZE };
string format = "D24S8";
string UIWidget = "None";
>;
///////////////////////////////////////////////////////////
/////////////////////////////////// data structures ///////
///////////////////////////////////////////////////////////

struct VS_OUTPUT_BLUR
{
float4 Position : POSITION;
float4 Diffuse : COLOR0;
float4 TexCoord0 : TEXCOORD0;
float4 TexCoord1 : TEXCOORD1;
float4 TexCoord2 : TEXCOORD2;
float4 TexCoord3 : TEXCOORD3;
float4 TexCoord4 : TEXCOORD4;
float4 TexCoord5 : TEXCOORD5;
float4 TexCoord6 : TEXCOORD6;
float4 TexCoord7 : TEXCOORD7;
float4 TexCoord8 : COLOR1;
};

struct VS_OUTPUT
{
float4 Position : POSITION;
float4 Diffuse : COLOR0;
float4 TexCoord0 : TEXCOORD0;
};

////////////////////////////////////////////////////////////
////////////////////////////////// vertex shaders //////////
////////////////////////////////////////////////////////////

VS_OUTPUT VS(float3 Position : POSITION,
float3 Normal : NORMAL,
float3 TexCoord : TEXCOORD0)
{
VS_OUTPUT OUT = (VS_OUTPUT)0;
OUT.Position = mul(float4(Position, 1), matWorldViewProj);
OUT.Diffuse = float4(baseColor,1);
OUT.TexCoord0 = float4(TexCoord, 1);
return OUT;
}

VS_OUTPUT VS_Quad(float3 Position : POSITION,
float3 TexCoord : TEXCOORD0)
{
VS_OUTPUT OUT = (VS_OUTPUT)0;
OUT.Position = float4(Position, 1);
OUT.TexCoord0 = float4(TexCoord, 1);
return OUT;
}

VS_OUTPUT_BLUR VS_Quad_Vertical_9tap(float3 Position : POSITION,
float3 TexCoord : TEXCOORD0)
{
VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
OUT.Position = float4(Position, 1);

float3 Coord = float3(TexCoord.x + TexelIncrement, TexCoord.y + TexelIncrement, 1);
OUT.TexCoord0 = float4(Coord.x, Coord.y + TexelIncrement, TexCoord.z, 1);
OUT.TexCoord1 = float4(Coord.x, Coord.y + TexelIncrement * 2, TexCoord.z, 1);
OUT.TexCoord2 = float4(Coord.x, Coord.y + TexelIncrement * 3, TexCoord.z, 1);
OUT.TexCoord3 = float4(Coord.x, Coord.y + TexelIncrement * 4, TexCoord.z, 1);
OUT.TexCoord4 = float4(Coord.x, Coord.y, TexCoord.z, 1);
OUT.TexCoord5 = float4(Coord.x, Coord.y - TexelIncrement, TexCoord.z, 1);
OUT.TexCoord6 = float4(Coord.x, Coord.y - TexelIncrement * 2, TexCoord.z, 1);
OUT.TexCoord7 = float4(Coord.x, Coord.y - TexelIncrement * 3, TexCoord.z, 1);
OUT.TexCoord8 = float4(Coord.x, Coord.y - TexelIncrement * 4, TexCoord.z, 1);
return OUT;
}

VS_OUTPUT_BLUR VS_Quad_Horizontal_9tap(float3 Position : POSITION,
float3 TexCoord : TEXCOORD0)
{
VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
OUT.Position = float4(Position, 1);

float3 Coord = float3(TexCoord.x + TexelIncrement, TexCoord.y + TexelIncrement, 1);
OUT.TexCoord0 = float4(Coord.x + TexelIncrement, Coord.y, TexCoord.z, 1);
OUT.TexCoord1 = float4(Coord.x + TexelIncrement * 2, Coord.y, TexCoord.z, 1);
OUT.TexCoord2 = float4(Coord.x + TexelIncrement * 3, Coord.y, TexCoord.z, 1);
OUT.TexCoord3 = float4(Coord.x + TexelIncrement * 4, Coord.y, TexCoord.z, 1);
OUT.TexCoord4 = float4(Coord.x, Coord.y, TexCoord.z, 1);
OUT.TexCoord5 = float4(Coord.x - TexelIncrement, Coord.y, TexCoord.z, 1);
OUT.TexCoord6 = float4(Coord.x - TexelIncrement * 2, Coord.y, TexCoord.z, 1);
OUT.TexCoord7 = float4(Coord.x - TexelIncrement * 3, Coord.y, TexCoord.z, 1);
OUT.TexCoord8 = float4(Coord.x - TexelIncrement * 4, Coord.y, TexCoord.z, 1);
return OUT;
}

VS_OUTPUT_BLUR VS_Quad_Vertical_5tap(float3 Position : POSITION,
float3 TexCoord : TEXCOORD0)
{
VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
OUT.Position = float4(Position, 1);

float3 Coord = float3(TexCoord.x + TexelIncrement, TexCoord.y + TexelIncrement, 1);
OUT.TexCoord0 = float4(Coord.x, Coord.y + TexelIncrement, TexCoord.z, 1);
OUT.TexCoord1 = float4(Coord.x, Coord.y + TexelIncrement * 2, TexCoord.z, 1);
OUT.TexCoord2 = float4(Coord.x, Coord.y, TexCoord.z, 1);
OUT.TexCoord3 = float4(Coord.x, Coord.y - TexelIncrement, TexCoord.z, 1);
OUT.TexCoord4 = float4(Coord.x, Coord.y - TexelIncrement * 2, TexCoord.z, 1);
return OUT;
}

VS_OUTPUT_BLUR VS_Quad_Horizontal_5tap(float3 Position : POSITION,
float3 TexCoord : TEXCOORD0)
{
VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
OUT.Position = float4(Position, 1);

float3 Coord = float3(TexCoord.x + TexelIncrement, TexCoord.y + TexelIncrement, 1);
OUT.TexCoord0 = float4(Coord.x + TexelIncrement, Coord.y, TexCoord.z, 1);
OUT.TexCoord1 = float4(Coord.x + TexelIncrement * 2, Coord.y, TexCoord.z, 1);
OUT.TexCoord2 = float4(Coord.x, Coord.y, TexCoord.z, 1);
OUT.TexCoord3 = float4(Coord.x - TexelIncrement, Coord.y, TexCoord.z, 1);
OUT.TexCoord4 = float4(Coord.x - TexelIncrement * 2, Coord.y, TexCoord.z, 1);
return OUT;
}

//////////////////////////////////////////////////////
////////////////////////////////// pixel shaders /////
//////////////////////////////////////////////////////

// just map the glow-mask texture to the screen - no lighting
// this shader will draw to a texture
float4 PS_BlurBuffer(VS_OUTPUT IN) : COLOR
{
float3 Col = IN.Diffuse * tex2D(ModelTexSamp, float2(IN.TexCoord0.xy)).xyz;
Col *= fIntensity;
return float4(Col,1);
}

////////

// For two-pass blur, we have chosen to do the horizontal blur FIRST. The
// vertical pass includes a post-blur scale factor.

// Relative filter weights indexed by distance from "home" texel
// This set for 9-texel sampling
#define WT9_0 1.0
#define WT9_1 0.8
#define WT9_2 0.6
#define WT9_3 0.4
#define WT9_4 0.2

// Alt pattern -- try your own!
// #define WT9_0 0.1
// #define WT9_1 0.2
// #define WT9_2 3.0
// #define WT9_3 1.0
// #define WT9_4 0.4

#define WT9_NORMALIZE (WT9_0+2.0*(WT9_1+WT9_2+WT9_3+WT9_4))

float4 PS_Blur_Horizontal_9tap(VS_OUTPUT_BLUR IN) : COLOR
{
float4 OutCol = tex2D(GlowSamp1, IN.TexCoord0) * (WT9_1/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord1) * (WT9_2/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord2) * (WT9_3/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord3) * (WT9_4/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord4) * (WT9_0/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord5) * (WT9_1/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord6) * (WT9_2/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord7) * (WT9_3/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord8) * (WT9_3/WT9_NORMALIZE);
return OutCol;
}

float4 PS_Blur_Vertical_9tap(VS_OUTPUT_BLUR IN) : COLOR
{
float4 OutCol = tex2D(GlowSamp2, IN.TexCoord0) * (WT9_1/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord1) * (WT9_2/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord2) * (WT9_3/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord3) * (WT9_4/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord4) * (WT9_0/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord5) * (WT9_1/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord6) * (WT9_2/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord7) * (WT9_3/WT9_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord8) * (WT9_3/WT9_NORMALIZE);
return Glowness*OutCol;
}

// Relative filter weights indexed by distance from "home" texel
// This set for 5-texel sampling
#define WT5_0 1.0
#define WT5_1 0.8
#define WT5_2 0.4

#define WT5_NORMALIZE (WT5_0+2.0*(WT5_1+WT5_2))

float4 PS_Blur_Horizontal_5tap(VS_OUTPUT_BLUR IN) : COLOR
{
float4 OutCol = tex2D(GlowSamp1, IN.TexCoord0) * (WT5_1/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord1) * (WT5_2/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord2) * (WT5_0/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord3) * (WT5_1/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp1, IN.TexCoord4) * (WT5_2/WT5_NORMALIZE);
return OutCol;
}

float4 PS_Blur_Vertical_5tap(VS_OUTPUT_BLUR IN) : COLOR
{
float4 OutCol = tex2D(GlowSamp2, IN.TexCoord0) * (WT5_1/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord1) * (WT5_2/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord2) * (WT5_0/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord3) * (WT5_1/WT5_NORMALIZE);
OutCol += tex2D(GlowSamp2, IN.TexCoord4) * (WT5_2/WT5_NORMALIZE);
return Glowness*OutCol;
}

////////

// just drawn model itself

float4 PS_Model(VS_OUTPUT IN) : COLOR
{
float4 Col = IN.Diffuse * tex2D(ModelTexSamp, float2(IN.TexCoord0.xy));
return Col;
}

// add glow on top of model

float4 PS_GlowPass(VS_OUTPUT IN) : COLOR
{
float4 tex = tex2D(GlowSamp1, float2(IN.TexCoord0.x, IN.TexCoord0.y));
return tex;
}

////////////////////////////////////////////////////////////
/////////////////////////////////////// techniques /////////
////////////////////////////////////////////////////////////

//////////////

technique Glow_5Tap


{

pass BlurPass

{
cullmode = none;
ZEnable = true;
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_2_0 PS_BlurBuffer();

}
pass BlurGlowBuffer_Horz

{
cullmode = none;
ZEnable = false;
VertexShader = compile vs_2_0 VS_Quad_Horizontal_5tap();
PixelShader = compile ps_2_0 PS_Blur_Horizontal_5tap();
}
pass BlurGlowBuffer_Vert

{
cullmode = none;
ZEnable = false;
VertexShader = compile vs_2_0 VS_Quad_Vertical_5tap();
PixelShader = compile ps_2_0 PS_Blur_Vertical_5tap();
}
pass ModelPass


{
ZEnable = true;
ZWriteEnable = true;
AlphaBlendEnable = false;
AlphaTestEnable = false;
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_2_0 PS_Model();
}
pass GlowPass

{
cullmode = none;
ZEnable = false;
ZWriteEnable = false;
AlphaBlendEnable = true;
SrcBlend = one;
DestBlend = one;
VertexShader = compile vs_1_1 VS_Quad();
PixelShader = compile ps_2_0 PS_GlowPass();
}
}

//////////////

technique NoGlow
{
pass ObjectRender
{
ZWriteEnable = true;
AlphaBlendEnable = false;
AlphaTestEnable = false;
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_1_1 PS_Model();
}
}
Posted By: Joey

Re: How to:Render Target? - 05/31/08 19:05

hmm. i see that you have major issues... download the shader workshop from jcl, you can find it by searching the online (!) manual (go to the beta page) for shader related stuff. there's a link somewhere.
Posted By: MMike

Re: How to:Render Target? - 05/31/08 19:56

im downloading the jcl workshop. i hope everything is on my side, i really want to post processing using the stage, but im afraid its just for C-lite.
Posted By: MMike

Re: How to:Render Target? - 05/31/08 20:11

the fx recognized the target map, but i cannot assign
camera.material =xxx, gives error. at starting :hum pitty.
Posted By: Joey

Re: How to:Render Target? - 06/01/08 09:00

what are you assigning to camera.material?
Posted By: Slin

Re: How to:Render Target? - 06/01/08 14:01

It only works with Lite-C!
Posted By: MMike

Re: How to:Render Target? - 06/01/08 16:12

frown oh my bad :/(/(( frown
thats soo unfair.
i assigned to my camera a material but it gives a startup error , like saying unknown command or something i don't know now.

frown Ok this needs a plugins, for sure. How i do know the glow thing wihout this stage way. it ecognized the targetmap in the fx file, but what i do with tthat, if i cannot use it.
Posted By: Joey

Re: How to:Render Target? - 06/01/08 17:27

why don't you use lite-c when you own a7?
Posted By: MMike

Re: How to:Render Target? - 06/01/08 20:12

? what you mean? let c-script forever?
i just feel more confortable with c-scrip... maybe im not yet ready on lite-c. it would need alot to convert scripts for a whole project too.

i don't know, maybe i will think about it.
Can lite-c and c-script be mixed in the same appl?
like, this part of code i want to act like lite-c the other not
© 2024 lite-C Forums