PC Review


Reply
Thread Tools Rate Thread

3d rendering in .net?

 
 
Jmc
Guest
Posts: n/a
 
      17th Jul 2006
Hi
I would like to apply a bumpmap on an image
(I have both the image and the bumpmap).
What techniqe is best for that?
It's a static image (no movements).
Any sample code?

(I'm using c#)

/Jimmy

 
Reply With Quote
 
 
 
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      17th Jul 2006
Jmc wrote:

> Hi
> I would like to apply a bumpmap on an image
> (I have both the image and the bumpmap).
> What techniqe is best for that?
> It's a static image (no movements).
> Any sample code?
>
> (I'm using c#)


If there's no movement, in de demoscene we always said: "Precalc!" so
I'd pre-apply the bumpmap in an image program like photoshop or Gimp
and use the result in your application.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
Jmc
Guest
Posts: n/a
 
      17th Jul 2006

Frans Bouma [C# MVP] wrote:

>
> If there's no movement, in de demoscene we always said: "Precalc!" so
> I'd pre-apply the bumpmap in an image program like photoshop or Gimp
> and use the result in your application.


Thanks for the answer.
What I ment with no movement is that I don't need any animations.
What my application does is generating an image and a bumpmap from
different fileformats.
So the only thing I want to be able to do, is apply the bumpmap on an
image and setup 1 (or more) light source.

/Jimmy

 
Reply With Quote
 
Stephan Rose
Guest
Posts: n/a
 
      17th Jul 2006
On Mon, 17 Jul 2006 00:57:09 -0700, "Frans Bouma [C# MVP]"
<(E-Mail Removed)> wrote:

>Jmc wrote:
>
>> Hi
>> I would like to apply a bumpmap on an image
>> (I have both the image and the bumpmap).
>> What techniqe is best for that?
>> It's a static image (no movements).
>> Any sample code?
>>
>> (I'm using c#)

>
> If there's no movement, in de demoscene we always said: "Precalc!" so
>I'd pre-apply the bumpmap in an image program like photoshop or Gimp
>and use the result in your application.
>
> FB


I'd have to agree and I am ex-movement from the demoscene =)

Managed DirectX would be total overkill for what you are doing, and I
have done a 2D Bumpmapping algorithm a long time ago with moving
lights and such, it looked really cool...but I can't remember the
details how I did it, been way too long ago.

The only thing is if he intends to load any arbitrary image at runtime
and apply the bumpmap to it...precalc is not an option.

Best bet I can suggest in that case is, Google!! Prolly not going to
find C# code but some C code is easy to find.

--
Stephan
2003 Yamaha R6

kimi no koto omoidasu hi
nante nai no wa
kimi no koto wasureta toki ga nai kara
 
Reply With Quote
 
Jmc
Guest
Posts: n/a
 
      17th Jul 2006
Hi
An addition to my question, using some kind of existing bumpmapping
renderer (for example Direct3D) would it be possible to add Silver
effects on my image?
For example a small portion of the image would look like silver or gold
and react to the light source as real as possible (again no movement,
atleast not in version 1) .

Best regards
/Jimmy

 
Reply With Quote
 
Stephan Rose
Guest
Posts: n/a
 
      17th Jul 2006
On 17 Jul 2006 06:14:15 -0700, "Jmc" <(E-Mail Removed)> wrote:

>Hi
>An addition to my question, using some kind of existing bumpmapping
>renderer (for example Direct3D) would it be possible to add Silver
>effects on my image?
>For example a small portion of the image would look like silver or gold
>and react to the light source as real as possible (again no movement,
>atleast not in version 1) .


Anything is possible. If you are going to use Direct3D you are going
to have to learn how to use pixel shaders. There are magnitudes of
amazing effects possible with those. Lots of tutorials available on
the net as well that explain how to do this with sample textures,
bumpmaps, code, etc. Heck, just look into the DirectX SDK and I am
sure they got a bumpmapping example there somewhere. I know they used
to. If not, Google will definitely turn something up.

The thing is, you can't do this with "no movement". To be able to
calculate such lighting effects you need to define a light with a
position and a directional vector. So you already need all the
necessary components just to be able to do the effect that you need to
be able to do movement. In case of movement you would just change your
directional vector and / or light position and redraw your image using
the new settings. Bottom line, movement is something you can do for
free, doesn't cost any additional work or CPU/GPU time.

I wish I still had some of my old code to give you. But the last demo
I did was for Razor 1911 back when my Riva TNT2 was like top of the
line....don't have any of that stuff anymore =(

--
Stephan
2003 Yamaha R6

kimi no koto omoidasu hi
nante nai no wa
kimi no koto wasureta toki ga nai kara
 
Reply With Quote
 
Jmc
Guest
Posts: n/a
 
      18th Jul 2006
Thanks Stephan
I'll look into it..
Basically I didn't want to learn all there is about Direct X (or open
gl) just to be able to do (what I think is a simple thing) but i'll
give it a go =)
Thanks again.

/Jimmy

 
Reply With Quote
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      18th Jul 2006
Jmc wrote:

>
> Frans Bouma [C# MVP] wrote:
>
> >
> > If there's no movement, in de demoscene we always said: "Precalc!"
> > so I'd pre-apply the bumpmap in an image program like photoshop or
> > Gimp and use the result in your application.

>
> Thanks for the answer.
> What I ment with no movement is that I don't need any animations.
> What my application does is generating an image and a bumpmap from
> different fileformats.
> So the only thing I want to be able to do, is apply the bumpmap on an
> image and setup 1 (or more) light source.


Ah ok, well if it helps, check this sourcecode of my rotozoomer in C#,
which shows you how to do fast image processing per pixel. You can use
this to apply a bumpmap using normal software rendering techniques
(i.e.: without going to the hardware through dx/ogl)

http://weblogs.asp.net/fbouma/archiv...25/433976.aspx

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
Stephan Rose
Guest
Posts: n/a
 
      18th Jul 2006
On 17 Jul 2006 23:32:24 -0700, "Jmc" <(E-Mail Removed)> wrote:

>Thanks Stephan
>I'll look into it..
>Basically I didn't want to learn all there is about Direct X (or open
>gl) just to be able to do (what I think is a simple thing) but i'll
>give it a go =)
>Thanks again.


Well unlike OpenGL which I figure is still a mess of dozens and dozens
of vendor specific extensions, DirectX actually has become exceedingly
simple to use.

The SDK Help has a simple step by step tutorial which will show you
everything you need to know to get the device initialized and do some
basic rendering of geometry. Shouldn't take you very long to go
through all that and it will give you a very good start.

Once you have this working you have a reasonable foundation to add
your bump mapping functionality on.

--
Stephan
2003 Yamaha R6

kimi no koto omoidasu hi
nante nai no wa
kimi no koto wasureta toki ga nai kara
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rendering Yama Microsoft ASP .NET 5 21st Oct 2005 10:12 PM
better for rendering Daniel P Computer Hardware 0 13th Aug 2004 08:00 AM
Rendering Tom Windows XP MovieMaker 0 22nd Jun 2004 09:28 PM
Rendering =?Utf-8?B?cGF1bA==?= Windows XP MovieMaker 7 18th Jun 2004 12:42 PM
VML Rendering in IE6 GA Windows XP Internet Explorer 0 10th Nov 2003 02:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 PM.