irrCg v0.8 (Initial) - CgFX (Texture States, MultiPass etc.)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

I released version 0.3 :) All features are in ReadMe.txt I update first post with link to current version.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
koller202
Posts: 143
Joined: Tue May 08, 2007 4:53 am
Location: Thailand

Post by koller202 »

this cg can use file export form rendermonkey ?

thank you
________
MEDICAL MARIJUANA PATIENT
Last edited by koller202 on Thu Feb 17, 2011 1:16 am, edited 1 time in total.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Sure :) Cg = HLSL, so You can use HLSL shaders from RenderMonkey as Cg:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Bah,

i know it might be really frustrating but i cant get stuff off of rapidshare?

pls host somehwere else :)

if you need some whre let me know
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

I send v0.3 on sendspace:) I've done access for all Matrix and for Transformation it:) I release all as v0.4 but now I write port for Linux and after it, I release 0.4:) (1-3 days)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

ok , no problem ;)

i would need a link tho,

If you are interested in hosting a webpage/download page private message me ok?
benny53
Posts: 131
Joined: Fri May 26, 2006 10:21 pm
Location: Ohio

Post by benny53 »

thought I'd say (since the readme says that vista wasn't tested) that they all work great with Windows Vista Home Premium 32 bit edition. So you can say that that has been tested. I get around 500 fps. Which is wierd,cuz I have an 8800gts,but I don't think its my hardware(I think vista is eating my ram,but I'm not sure). So yeah,it works on vista 32 bit.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Thanks for test:) Yes probably this is Vista problem. How FPS You have got if You not visible vertex in this demo? (draw polys: 0) If around 500 this is no hardware problem, but software:) I add Vista 32-bit support for checked:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

I've done version 0.4 of CG Binding. In this version eg. You Can Access for 5 Matrices. This is next release only for Windows (In last time I have some problem with my dev environment in my Fedora 7, so I can't make version for Linnux in this release). In this demo I add example about Normal Mapping. Now You have lighting like DOOM 3 in Yours Irrlicht Application, now it is possible:) (I show effect on DOOM 3 model - IMP, effect look identically like DOOM 3, but is free). Of course I update first post for download info;)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Nadro wrote:I show effect on DOOM 3 model - IMP, effect look identically like DOOM 3, but is free). Of course I update first post for download info;)
That's a coincidence - I did something like that 8 months ago. The "new" Irrlicht animation system started shortly after so I didn't do any more work on the MD5 loader. The original demo is still available on my website.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

This topic is about CG and this is mainly theme, but binding without good examples?:) Of cource You made similar effect ~8 months ago, but without visible specular and I not tell, than my demo is first with Normall Mapping, but this is first full properly Normal Mapping example in CG for Irrlicht with CG support:), and hmm Your demo is only for DirectX or OpenGL? I not remember, but MD5 loader is very good:) Thats fact shaders and effect are similar. I'm don't know who is first developer this shader, but this is not me:)

PS. Meybe You planning release source code of Yours loader?:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks Nadro.

This is just the thing I needed for my next project!

Your normal mapping example is just what I was for!

From the example, you have some dynamic lighting from the shader? The model seem to be lit from the font.

I'll try to get rendermonkey and try it. But the base code from your example for NormalMapping is what I need.
:)
Thanks!
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Hello,

I tried getting the normalmap code to work in Rendermonkey by directly copying the .cg code to it, but some error showed up (with my shallow understanding of hlsl I don't know how to fix :( ). Is cg the same same as hlsl or do I have to change something to get it to work with Irrlicht or Rendermonkey?

Thanks
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Great, it looks so sweet. :D
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Some small changes, and now it compiles fine in both irrlicht and rendermonkey, but nothing showed up.

Can anyone spot any mistake in the code(hlsl)?

vertex shader:

Code: Select all

   float4 lightPosition; // Object Space
   float3 eyePosition;  // Object space 
   float4x4 WorldViewProj;

void vsmain(float4 Position: POSITION, 
   float3 Normal: NORMAL, 
   float2 Uv: TEXCOORD0,
   float3 Tangent: TEXCOORD1,
   float3 Binormal: TEXCOORD2,

   out float4 oPosition: POSITION, 
   out float2 oUv: TEXCOORD0, 
   out float3 oLightDir: TEXCOORD1, // Tangent Space
   out float3 oEyeDir: TEXCOORD2, // Tangent Space
   out float3 oHalfAngle: TEXCOORD3 // Tangent Space

) 
{  
   oPosition = mul(WorldViewProj, Position); 

   oUv = Uv;
   float3 LightDir = normalize(lightPosition.xyz -  (Position * lightPosition.w));
   float3 EyeDir = eyePosition - Position.xyz; 
    
   float3x3 TBN = float3x3(Tangent, Binormal, Normal); 
    
   // Transformacja do Tangent Space
   LightDir = normalize(mul(TBN, LightDir)); 
   EyeDir = normalize(mul(TBN, EyeDir)); 

   oLightDir = LightDir; 
   oEyeDir = EyeDir; 
   oHalfAngle = normalize(EyeDir + LightDir); 
}
I really appreciate it.

pixel shader:

Code: Select all

   float3 LightDiffuse;
   sampler2D DecalMap: register(s0);
   sampler2D NormalMap: register(s1);
   sampler2D SpecularMap: register(s2);
   /* Parallax Mapping
   uniform sampler2D HeightMap,*/
   
   

void psmain(float2 Uv: TEXCOORD0,
   float3 LightDir : TEXCOORD1,
   float3 EyeDir : TEXCOORD2,
   float3 HalfAngle : TEXCOORD3,



   out float4 oColor : COLOR)
{
   float2 TexCoord;

   /* Parallax Mapping
   float Height = tex2D (HeightMap, Uv).r;
   Height = Height * 0.04 - 0.02;
   float3 Eye = normalize (EyeDir);
   TexCoord = (Height * Eye.xy) + Uv;
   */
   // else
   TexCoord = Uv;

   float3 Normal = 2.0 * tex2D (NormalMap, TexCoord).rgb - 1.0;
   Normal = normalize (Normal);

   // Œwiat³o rozproszenia
   float3 Diffuse = max (dot (LightDir, Normal), 0.0) * LightDiffuse;
   float3 DecalColor = tex2D (DecalMap, TexCoord).rgb;

   float3 SpecularColor = tex2D(SpecularMap, TexCoord).rgb;

   float Specular = max (dot (HalfAngle, Normal), 0.0);
   Specular = pow (Specular, 8.0);

   oColor = float4 (DecalColor * Diffuse + Specular * SpecularColor, 1.0);
}
Post Reply