• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

whysee

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

127 Neutral

About whysee

  • Rank
    Member
  1. I all I'm back in shader since ten years ... so I looking for a starting code to make a sort of wipe effect in 2D: I think its a classical effect but i can't find any example I need to make cursor as a moving shape on the screen that make appear a texture behind. If the cursor move again over the same path it reveals another texture behind. Every time the shape pass over a texture it reveals another texture behind it . etc. Is someone can give me a snipet as a starting point, I'm going in many direction but still stuck Thanks a lot
  2. Hi all maybe it's a stupid question but im stuck: what i wanna do is making a lookup in a cube map that simulate a spotlight like in http://www.ronfrazier.net/apparition/index.html the lookup is made by a vector from the vertex to the light. color = textureCube(EnvMap, light2Dir); it works well but my map is centered so the light seems to come from the center of the scene also i need to move it for each spotlight how can i move this cube map to the position of the light ? thanx for your help
  3. hi all i've made glsl shader that cast two spotlights on a scene. it's work really good but when i get closer the framerate drops down what the explanation of this phenomena ? i think the decreasing of perf come from the number of fragment effectively processed to do the lighting but what are the tricks to get good perf on very close views is someone has an example of indexed map ligthing in glsl maybe its faster ? thanks [Edited by - whysee on October 28, 2005 11:24:38 AM]
  4. Quote:Original post by eviltwigflipper Quote:Original post by whysee but i want a do i by a GLSL shader im a newbie in this scope Theres like no advantages in doing it in a shader, your better off using glBlend, and it will probley be faster. yes it's faster but my point is to do some per pixel shading. i have many spotlights casting their beam on flat surfaces like cubes, so per vertex don't fit
  5. ok so here is the new frag I control my light[0] parameters for each pass corresponding to each "real" light in my application void main() { vec4 diffuse1,ambient1; vec3 n,halfV; float NdotL,NdotHV; vec4 color = ambientGlobal; vec4 color2= vec4(0.0,0.0,0.0,1.0);// = ambientGlobal; float att,spotEffect; float dist1 = length(lightDir1); /* Compute the diffuse, ambient and globalAmbient terms */ diffuse1 = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse; ambient1 = gl_FrontMaterial.ambient * gl_LightSource[0].ambient; /* a fragment shader can't write a verying variable, hence we need a new variable to store the normalized interpolated normal */ n = normalize(normal); /* compute the dot product between normal and ldir */ NdotL = max(dot(n,normalize(lightDir1)),0.0); if (NdotL > 0.0) { spotEffect = dot(normalize(gl_LightSource[0].spotDirection), normalize(-lightDir1)); if (spotEffect > gl_LightSource[0].spotCosCutoff) { spotEffect = pow(spotEffect, gl_LightSource[0].spotExponent); att = spotEffect / (gl_LightSource[0].constantAttenuation + gl_LightSource[0].linearAttenuation * dist1 + gl_LightSource[0].quadraticAttenuation * dist1 * dist1); color += att * (diffuse1 * NdotL + ambient1); halfV = normalize(halfVector1); NdotHV = max(dot(n,halfV),0.0); color += att * gl_FrontMaterial.specular * gl_LightSource[0].specular * pow(NdotHV,gl_FrontMaterial.shininess); } } gl_FragColor = color; } in my app : something like : for nb lights setGLLightPos(glLightNum, pos); swapBuffer(); do you think it's a good way to do such a thing BTW you said that conditonnals block are in concern for shader perf do you have any pointer or more advices on the subject do you think a sort of cubemap lighting can be more efficient. I lack of knowledge in this topic
  6. but i want a do i by a GLSL shader im a newbie in this scope so i don't know how to do a multi-light shader here is what i begin the problem is that is very ugly i just have duplicated the two process for the two spotlight how could i do for any number of ligths void main() { vec4 diffuse1,ambient1; vec4 diffuse2,ambient2; vec3 n,halfV; float NdotL,NdotHV; vec4 color = ambientGlobal; vec4 color2= vec4(0.0,0.0,0.0,1.0);// = ambientGlobal; float att,spotEffect; float dist1 = length(lightDir1); float dist2 = length(lightDir2); /* Compute the diffuse, ambient and globalAmbient terms */ diffuse1 = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse; ambient1 = gl_FrontMaterial.ambient * gl_LightSource[0].ambient; diffuse2 = gl_FrontMaterial.diffuse * gl_LightSource[1].diffuse; ambient2 = gl_FrontMaterial.ambient * gl_LightSource[1].ambient; /* a fragment shader can't write a verying variable, hence we need a new variable to store the normalized interpolated normal */ n = normalize(normal); /* compute the dot product between normal and ldir */ NdotL = max(dot(n,normalize(lightDir1)),0.0); if (NdotL > 0.0) { spotEffect = dot(normalize(gl_LightSource[0].spotDirection), normalize(-lightDir1)); if (spotEffect > gl_LightSource[0].spotCosCutoff) { spotEffect = pow(spotEffect, gl_LightSource[0].spotExponent); att = spotEffect / (gl_LightSource[0].constantAttenuation + gl_LightSource[0].linearAttenuation * dist1 + gl_LightSource[0].quadraticAttenuation * dist1 * dist1); color += att * (diffuse1 * NdotL + ambient1); halfV = normalize(halfVector1); NdotHV = max(dot(n,halfV),0.0); color += att * gl_FrontMaterial.specular * gl_LightSource[0].specular * pow(NdotHV,gl_FrontMaterial.shininess); } } ///* NdotL = max(dot(n,normalize(lightDir2)),0.0); if (NdotL > 0.0) { spotEffect = dot(normalize(gl_LightSource[1].spotDirection), normalize(-lightDir2)); if (spotEffect > gl_LightSource[1].spotCosCutoff) { spotEffect = pow(spotEffect, gl_LightSource[1].spotExponent); att = spotEffect / (gl_LightSource[1].constantAttenuation + gl_LightSource[1].linearAttenuation * dist2 + gl_LightSource[1].quadraticAttenuation * dist2 * dist2); color2 += att * (diffuse2 * NdotL + ambient2); halfV = normalize(halfVector2); NdotHV = max(dot(n,halfV),0.0); color2 += att * gl_FrontMaterial.specular * gl_LightSource[1].specular * pow(NdotHV,gl_FrontMaterial.shininess); } } //*/ gl_FragColor = color2+ color; } my problem is also in term of performance one more light decrease famerate a lot please need help or any pointers on multi light shader
  7. hi all I'm looking for a method to create multiple dynamic spotligths i've tryed to write a fragment program using an opengl ligth it's cool but what can i do if i want more lights do i duplicates values and calculation ? so try two spotlights and the performance decrease dramatically I've heard about other techniques still using glsl is someone can give me some example of multi spotlights rendering that works ? tanx
  8. thanks for your answer I'm wondering if something like Cg SDK or an other one working on linux can help writing vertex program, if someone has set up a good environment for that. Or if there a way to write GLSL code to be converted in ARBvp/fp1.0 I have read some spec on ARBvp assembly so I think i could understand something but my was on a good tutorial on how to make complex shader, passing parameters adding projective texture blending and so on .. I'm new to this post and maybe this question is an other topic for graphic theory ?
  9. hi all, I'm currently writing an online game where each player has a spotlight after testing many technique to get lighting and shadows for multiple lights I found it's more extensible to write it out as a shader but ... it seem difficult for me to find a good starting point : my app ONLY support ARBvp1.0 and ARBfp1.0 Where I can find a good tutorial on how to write such files ? I need advices for a good way to write it Do I need SDK if exists where I can test my effects ? I'm on linux with a GeForce3