irrCg v0.8 (Initial) - CgFX (Texture States, MultiPass etc.)
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
Last edited by koller202 on Thu Feb 17, 2011 1:16 am, edited 1 time in total.
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
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
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
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
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.
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
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
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 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;)
Irrlicht Demos: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=45781
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?:)
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
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
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!
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!
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
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
Great, it looks so sweet.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
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:
I really appreciate it.
pixel shader:
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);
}
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);
}