Source hacking

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Guest

Source hacking

Post by Guest »

I was thinking about modifying the Irrlicht engine to support more than 2 texture layers and Cg vertex/fragment programs. What do people think about this?

-- John
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Go and try, then send the working code to niko and he'll maybe add it to the next version :)
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

look into the news niko is already working on an improved material system
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
Guest

Post by Guest »

Yeah, I noticed that -- but on the dev page, the "Refactoring" task is at 0%, which is what I would think the new material system would be under. So I figure I'd take a stab at it.

-- John
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

If you really wanted to do something that people really want that isn't likely to be added in the next version then go for implementing the CG language and effects so that shaders can be used. That would be the most useful thing to be getting on with if you think you've got the knowldege, I know I haven't.
Guest

Post by Guest »

Hmmmm, so I'm looking through the CVS on SF and I don't see any of the Irrlicht source in it. Is there a development branch I should be using somewhere, or should I just make changes to 0.6?

-- John
Guest

Post by Guest »

Ah, nevermind. The FAQ says that there is no CVS. I'll work with 0.6. It sounds like Niko wants to develop this by himself until 1.0. Do you think it's likely he'd accept my patch?

-- John
Hoff
Posts: 13
Joined: Sun Jun 27, 2004 5:59 pm

Post by Hoff »

Okay, this is what I've got so far. Some feedback would be nice, so I know if I'm following the general style/code structure rules for Irrlicht before I do too much more.

Anyway, I added two source files: CCGProgram.cpp/h, and modified CVideoOpenGL, SMaterial.h, irrlicht.h and the Makefile. The only change to CVideoOpenGL was a little code in setRenderState3D (or something like that) to bind to the VertexShader. I added CGProgram * VertexShader and CGProgram FragmentShader to SMaterial. The makefile and irrlicht.h have the obvious stupid little changes needed when adding files to the project.

At the moment, my code only works for OpenGL, although it should be trivial to port it to DirectX (I'd do it right now, but I don't have a Windows box).

CCGProgram.cpp
CCGProgram.h
CVideoOpenGL.cpp
SMaterial.h
irrlicht.h
Makefile

-- John
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

Do ATI videocards support Cg shading?
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Hoff
Posts: 13
Joined: Sun Jun 27, 2004 5:59 pm

Post by Hoff »

They do -- it's actually kinda cool what NVidia did with Cg. You can compile Cg code to different GPU assembly types, including ARB types, which ATI supports.

-- John
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Very nice, does it work? No time for a recompile here today, too busy with what I am doing :) Nice to see someone working on shaders, IMO that is one of the only reasons why OGRE would budge out Irrlicht ( apart from the odd bug or two :) ). I was more hoping than asking when I suggested working on shaders, never expected anyone to actually go out and do it, lol. I await with bated breath.
Hoff
Posts: 13
Joined: Sun Jun 27, 2004 5:59 pm

Post by Hoff »

It does work, but it's not complete. There are a couple things that need to be added for it to be useful, like matrix tracking, but they're all a few lines of code. My main concern is that it fits into the infrastructure well. I think it does, but then again I've only looked at the few source files that I've worked with, so I really don't have any sense of what the Irrlicht architecture looks like on a larger scale.

-- John
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

One thing, if you're changing things in existing source files as well as adding new files, please document the changes instead of just replacing the file. This allows people to add the changes to future versions (if the changes don't get included in the official release) or to add the changes to files they themselves have already modified. I had this problem with an .md3 loader someone had made for 0.5. They replaced a bunch of files, and when I switched them into 0.6 it didn't compile right.
Guest

Post by Guest »

Yeah, you're right. I'll post diffs (and comment more) in the future. I actually made more of an anouncement post in the Howto forum, as opposed to the 'maybe it would work' post in this forum, so I'll throw them there.

-- John
Post Reply