Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

112 Neutral

About mvtapia

  • Rank
  1. mvtapia

    Where to start?

    There are tons of places to start. Everybody is going to tell you to get another book and it's probably your best bet. Now, if you are a beginner and not interested in 3D yet, try java and flash games to start to get the concept about real game algorithms, like collision and physics, among other things. To get started with 2D games you don't really need a book. Just tutorials and articles posted in gamedev.net or gamasutra. I will tell you what I did, I started learning 3D programming from the get go. But doing 2D stuff, why? because 3D games can look 2D depending on the camara angle and it was a challenge. After I learned, the basic cube, lights, 2D animation, camera and other simple concepts that you will learn with tutorials, I bought a book. Now, when you know the basic stuff and get an intermediate or advance book, is the most exciting thing. You bearly understand, and you have to read it 2 times or more to understand everything, but when you finish, your learning curve has sky rocket. To start game programming is not hard as a hobby, you have so many tools out there to help you. I will tell you if you want to get serious, C++ is definedly the way to go. Do as many tutorials and understand them (no copy-paste). Get a advance book. Google "game programming tutorial". Hope it helps.
  2. Well, I tryied to do the support for both and I think is hell. I think is better to use unicode only, since you can do anything with it. using #ifdef inside the code is really annoying and you need to define the specific A/W function you want to use in each case. And if the #define is for a class... haha... you need to make two classes... But i also agree that you run into a lot of problems using unicode only. I think the best option for the hobby game programmer or for the programer doing games in english is to stay with MBS, easier and you don't have to put L" before every constant string. Wierd, many people from japan.. maybe is the time of the tread.
  3. mvtapia

    Smoking and Smokers!

    I will not defend smokers like my self, the point is if you really want to save us smokers then make it ilegal... the thing is me as a smoker would much rather have it that way. If I can't have it then I will be OK, smoking is an addiction and is hard to quit. There is a hard truth about smokers, specially the ones that have been smoking for a long time, they all want to quit to a certain level. A soon as your chest starts falling apart, then you start thinking about it. The problem is that people make us look like some alien creatures that should not be part of society. About the second hand burger, "BULLSHIT". People die more for eating shit that from second hand smoke and the current brain wash in schools is just that. You just wait and see, In the 70's if you told somebody that "you were polluting someones air" you will get a big F**K U. Give it 20 years until the new kids are our age and you will see that cheese will come with a warning sticker, "EAT AT YOUR OWN RISK".
  4. well I tried it like colin said and I works ok, I think, The functions has the same name i just uses the one it needs.. one more thing, the UNICODE especific functions have to be declared with the unicode W at the end in order to correctly complile the library. If you use a class you have to make two diferent classes ex. ClassA and ClassW and then define #ifdef UNICODE #define Class ClassW #else #define Class ClassA #endif I think if microsoft does it then why cant we thanks
  5. mvtapia

    Smoking and Smokers!

    Next there will be, please don't eat that cheeseburger in front of me, your grossing me out!!!!!!!!! jajajajajajajaja.... Fat people are the next victim and the young generations are being groomed for that.
  6. mvtapia

    Smoking and Smokers!

    I've been a smoker for years and my first smoke was when I was like 20. Sure, cigarettes smell, they kill and do all sorts of things to your body. Don't be fooled people who smoke know this things and I've even heared people give the stupid response that there going to die anyway so they might as well do it while doing something they like. I think this is not a valid answer, your answer should be I smoke for the same reason people like cake, fat, candy, cheese, red meat and pretty much anything in this world that is really tasty and enjoyfull. Because I like it!!! Some people get high with taking a jog, playing video games and a lot of things, they found something that made them feel good. Cigarrets are addictive and there is no doubt but at the end of the day the reason grown people is becuase it releases stress very fast and they like it. The whole antismoking campain has been very good but when do you draw the line on free will. Now they have campain against second hand smoking, what the hell. I understand if you work in a club, or if your parents smoke in your face all day, but man, you can't smoke on the street without some asshole telling you, you are polluting his/hers air. what's up with that!!!
  7. Hello people, I want to write a library that supports both types of characters and I already wrote it so it would support both but I have a problem when the function is inside a class or a cpp file. I use #ifdef UNICODE and write the code for unicode and #else for multibyte. Now if I compile the library, I get linker errors because it doesn't know what to use. If I compile unicode and my program is using unicode, then is fine. If I compile the library in multibyte and the program uses multibyte, is fine too. The problem is when I compile the library, how do I compile the library so it supports boths. I think is because when I compile the library I'm already telling what to discriminate. Any suggestions. Thanks
  8. mvtapia

    Game Strings

    Well that's good but what about the other things. like Quote:If I'm making a game in Japanese, or asian characters, how do I get the input to a textbox with directinput, or is it not possible and I have to use standard windows api. Or how do you render the asian text on the screen while the user is typing.
  9. Hello everybody, I have a couple of question. What is the criteria I should consider when selecting a string for a game program. Should I use char or unicode. And if I'm just making a game in english, why should I use unicode. If I'm making a game in Japanese, or asian characters, how do I get the input to a textbox with directinput, or is it not possible and I have to use standard windows api. Or how do you render the asian text on the screen while the user is typing. Thanks.
  10. mvtapia

    Per pixel lighting in pipeline

    Quote:Any lighting equations implementing in the pixel shader are per-pixel, so yes - it's definitely possible in the programmable pipeline I stated the question wrong and I did not mean programmable pipeline, I was trying to say "in the program". I was asking if I can catch the pixel information and manipulate it before it is send to the card. So I can do the lighting equations in my program instead of the shader? It may be cool to have some calculations done before the shader. About normal mapping, I've read about it and I get what you are saying, is like preparing your pixel shader in your vertex shader. So far my card only supports ps_2_0 and that's why I can only do 2 point lights. I haven't even tried to do spots. Sorry for the misunderstanding.
  11. mvtapia

    Calculate the z-range of a light

    First you have to put the position and the direction in the equation, other wise you will draw from zero and in the same direction for all your lights. Now it seem that the term you have as x is what you are asking. you already have the depth of the light, you are just looking at it in 2D. Now, since you are saying that this is a spherical shape, this means that your Z term should be angle dependend. use the circle equation in terms of zy and put it with your current equation. (z - h)2 + (y - k)2 = r2 h and k are the circle center which in this case should fall in the direction vector. r is the y value form you current equation that will be the radius for a give x. so you should do this, first calculate the y, to find you radius for a given x value. then apply the circle equation to find the 3d position. (z - h)^2 + (y - k)^2 = (x/C^(2/3) - x^2 ) that should be your equation, I think. Let me know if it works.
  12. mvtapia

    Calculate the z-range of a light

    sorry bad post [Edited by - mvtapia on November 13, 2006 8:14:08 PM]
  13. mvtapia

    Calculate the z-range of a light

    I don't really understand what you are trying to do, I think you should try to make it a little more clear. Set an example about how your light should look like once is rendered and maybe people can help you a little better. Let me see if I'm getting what you are saying, the outline function is for shading? Or is it the shape of the light ray? Really don't understand.
  14. Hello everyone, I was wondering if it was possible to do per pixel lighting on the programming pipeline in directx. If you know an example or a tutorial that can achive this please let me know. I know how to do per pixel lighting with shaders and it looks great but I can only do two lights. For what is worth, if you know how to support more that two lights with pixel shaders, I'm sure my computers graphic card can't handle it but I will like to know anyway. Thanks.
  15. mvtapia

    Simple shader

    I have Finished the shader for a single light, it does self shadowing my only problem is that the monochrome technique, I cannot do lights, maybe I need to do another pass, but I have not been able to get it to work. So I anyone has any ideas I put another post to discuss that, or just post it here. // MARVIT ENGINE FX FILE. string description = "MARVIT ENGINE FX'S"; //------------------------------------ // Our Matrices. //------------------------------------ float4x4 matWorldViewProj : WorldViewProjection; float4x4 matView : ViewInverse; float4x4 matWorld : World; float4x4 matProj : Projection; //------------------------------------ // Our Texture. //------------------------------------ texture diffuseTexture : Diffuse; texture Shadow; //------------------------------------ // Our Lighting Variables. //------------------------------------ bool LightOn; // Lights is on float3 LightPos; // Light's Position in world space float4 LightDiffuse; // Light's diffuse color float Range; // Light's range. float4 Ambient; // Scene's ambient color int NumLights; // Number of Lights in the Scene. //------------------------------------ // Our Material Variables. //------------------------------------ float4 MaterialDiffuse; // Materials's Diffuse color float4 MaterialAmbient; // Materials's Ambient color float4 MaterialSpecular; // Materials's Specular color float4 MaterialEmissive; // Materials's Emissive color float Power; // Material Power. //------------------------------------ // Vertex Input Structure. //------------------------------------ struct vertexInput { float3 Position : POSITION0; float3 Normal : NORMAL0; float4 Texture : TEXCOORD0; }; //------------------------------------ // Vertex Output Structure. //------------------------------------ struct vertexOutput { float4 Position : POSITION0; float4 Texture : TEXCOORD0; float3 Normal : TEXCOORD1; float3 View : TEXCOORD2; float3 WorldPos : TEXCOORD3; }; //------------------------------------ // Normal Vertex Shader Routine. //------------------------------------ vertexOutput VS_Transform(vertexInput IN) { vertexOutput OUT; matWorldViewProj = mul(matWorld, mul(matView, matProj)); OUT.Position = mul( float4(IN.Position.xyz , 1.0) , matWorldViewProj); float3 worldEyePos = matWorld[3].xyz; float3 worldVertPos = mul(IN.Position, matWorld).xyz; OUT.Normal = normalize(mul(IN.Normal, matWorld)); //normal vector OUT.View = normalize(worldEyePos - worldVertPos); //eye vector OUT.View = normalize(worldEyePos - worldVertPos); //eye vector OUT.WorldPos = mul(IN.Position, matWorld); OUT.Texture = IN.Texture; return OUT; } //------------------------------------ // Pixel Input Structure. //------------------------------------ struct pixelInput { float4 Texture : TEXCOORD0; float4 Normal : TEXCOORD1; float3 View : TEXCOORD2; float3 WorldPos : TEXCOORD3; }; //------------------------------------ // Pixel Input Structure. //------------------------------------ struct pixelOutput { float4 Color : COLOR0; }; //------------------------------------ // Scene Texture Sampler. //------------------------------------ sampler2D SceneSampler = sampler_state { Texture = <diffuseTexture>; AddressU = Wrap; AddressV = Wrap; MinFilter = Point; MagFilter = Linear; MipFilter = Linear; }; //------------------------------------ // Shadow Texture Sampler. //------------------------------------ sampler2D g_samShadow = sampler_state { Texture = <Shadow>; MinFilter = Point; MagFilter = Point; MipFilter = Point; AddressU = Clamp; AddressV = Clamp; }; //----------------------------------- // Normal Pixel Shader Routine. //----------------------------------- pixelOutput PS_Textured( pixelInput IN ) : COLOR0 { pixelOutput OUT; OUT.Color = tex2D( SceneSampler, IN.Texture ); return OUT; } //----------------------------------- // Per Pixel Lighting Shader Routine Normal. //----------------------------------- pixelOutput PS_Lighting( pixelInput IN ) : COLOR0 { pixelOutput OUT; float3 normal = normalize (IN.Normal); float4 temp_Texture = tex2D( SceneSampler, IN.Texture ); // Do Lighting. float dist = length ( IN.WorldPos - LightPos); float3 direction = -1*normalize ( IN.WorldPos - LightPos); // Lighting variables. // Diffuse. float4 diff = saturate(dot(IN.Normal, direction)) * (MaterialDiffuse * LightDiffuse); // compute self-shadowing term float shadow = saturate(4* diff); // Specular. float3 Reflect = normalize(2 * diff * IN.Normal - direction); float4 specular = pow(saturate(dot(Reflect, IN.View)), Power) * MaterialSpecular; // Attenuation. float att = 1- (saturate (dist / Range)); // Resulting color. temp_Texture *= (((Ambient*MaterialAmbient) + shadow * ( diff + specular)) * att) + MaterialEmissive; OUT.Color = temp_Texture; return OUT; //return diffuseTexture; } //------------------------------------ // Monochrome Pixel Shader Routine. //------------------------------------ pixelOutput PS_Monochrome ( pixelInput IN ) : COLOR0 { pixelOutput OUT; float4 LuminanceConv = { 0.2125f, 0.7154f, 0.0721f, 1.0f }; float grayScale = dot( (float3)tex2D(SceneSampler, IN.Texture ), LuminanceConv); OUT.Color = float4(grayScale,grayScale,grayScale,1.0); return OUT; } //----------------------------------- // Normal Rendering Technique using Light. //----------------------------------- technique normal { pass p0 { VertexShader = compile vs_1_1 VS_Transform(); PixelShader = compile ps_2_0 PS_Lighting(); } } //----------------------------------- // Normal Rendering Technique no lights. //----------------------------------- technique nolight { pass p0 { VertexShader = compile vs_1_1 VS_Transform(); PixelShader = compile ps_2_0 PS_Textured(); } } It's all point lights, I think you can do pretty much everything with that if you can get a shadow casting technique working. Currently working on multiple lights.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!